Fix a heap lock/thread list lock deadlock.

We had an uncaught OOME whose uncaught exception handler -- running
with the thread lock held -- was trying to cause a GC while some
other thread had the heap lock and was waiting for the thread list
lock.

Change-Id: I22177129562268837127d9edcc63ef5e93054bdf
diff --git a/src/signal_catcher.cc b/src/signal_catcher.cc
index a129ba1..06491e4 100644
--- a/src/signal_catcher.cc
+++ b/src/signal_catcher.cc
@@ -62,7 +62,13 @@
 }
 
 void SignalCatcher::HandleSigQuit() {
-  Runtime::Current()->GetThreadList()->SuspendAll();
+  Runtime* runtime = Runtime::Current();
+  ThreadList* thread_list = runtime->GetThreadList();
+
+  LOG(INFO) << "Heap lock owner: " << Heap::GetLockOwner() << "\n"
+            << "Thread lock owner: " << thread_list->GetLockOwner() << "\n";
+
+  thread_list->SuspendAll();
 
   std::ostringstream os;
   os << "\n"
@@ -75,7 +81,7 @@
     os << "Cmd line: " << cmdline << "\n";
   }
 
-  Runtime::Current()->Dump(os);
+  runtime->Dump(os);
 
   std::string maps;
   if (ReadFileToString("/proc/self/maps", &maps)) {
@@ -84,7 +90,7 @@
 
   os << "----- end " << getpid() << " -----";
 
-  Runtime::Current()->GetThreadList()->ResumeAll();
+  thread_list->ResumeAll();
 
   LOG(INFO) << os.str();
 }