Fix the mutex diagnostics, and other targets of opportunity.

Three changes for the price of one:

1. Fix the mutex diagnostics so they work right during startup and shutdown.

2. Fix a memory leak in common_test.

3. Fix memory corruption in the compiler; we were calling memset(3) on a struct
with non-POD members.

Thanks, as usual, to valgrind(1) for the latter two (and several bugs in
earlier attempts at the former).

Change-Id: I15e1ffb01e73e4c56a5bbdcaa7233a4b5221e08a
diff --git a/src/runtime.cc b/src/runtime.cc
index 3aa7e6e..bedeb27 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -88,11 +88,9 @@
     Trace::Shutdown();
   }
 
-  Dbg::StopJdwp();
-
   // Make sure our internal threads are dead before we start tearing down things they're using.
+  Dbg::StopJdwp();
   delete signal_catcher_;
-  // TODO: GC thread.
 
   // Make sure all other non-daemon threads have terminated, and all daemon threads are suspended.
   delete thread_list_;