Use static thread safety analysis when available, and fix the bugs GCC finds.

It's impossible to express the Heap locking and the ThreadList locking with
GCC, but Clang is supposed to be able to do it. This patch does what's possible
for now.

Change-Id: Ib64a890c9d27c6ce255d5003cb755c2ef1beba95
diff --git a/src/trace.cc b/src/trace.cc
index aa6c523..a453e37 100644
--- a/src/trace.cc
+++ b/src/trace.cc
@@ -485,7 +485,6 @@
 }
 
 void Trace::DumpThreadList(std::ostream& os) {
-  ScopedThreadListLock thread_list_lock;
   Runtime::Current()->GetThreadList()->ForEach(DumpThread, &os);
 }
 
@@ -495,12 +494,7 @@
 
 void Trace::UninstallStubs() {
   Runtime::Current()->GetClassLinker()->VisitClasses(UninstallStubsClassVisitor, NULL);
-
-  // Restore stacks of all threads
-  {
-    ScopedThreadListLock thread_list_lock;
-    Runtime::Current()->GetThreadList()->ForEach(TraceRestoreStack, NULL);
-  }
+  Runtime::Current()->GetThreadList()->ForEach(TraceRestoreStack, NULL);
 }
 
 uint32_t TraceMethodUnwindFromCode(Thread* self) {