Ensure ThreadPool constructor does not return until fully initialized.

Thread pool was being deleted too early during runtime shutdown,
this was causing a GC running during runtime shutdown to
occasionally reference a deleted thread pool.

Fixed an error where the thread pool was being deleted before the
threads were done attaching by making the thread pool constructor
block until all of the threads are attached.

Change-Id: I5f0884a74d78c4541ee0e582112857077f3f594f
diff --git a/src/runtime.cc b/src/runtime.cc
index 6dc8435..c84f1f6 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -115,8 +115,6 @@
 }
 
 Runtime::~Runtime() {
-  heap_->DeleteThreadPool();
-
   Thread* self = Thread::Current();
   {
     MutexLock mu(self, *Locks::runtime_shutdown_lock_);
@@ -133,6 +131,7 @@
 
   // Make sure to let the GC complete if it is running.
   heap_->WaitForConcurrentGcToComplete(self);
+  heap_->DeleteThreadPool();
 
   // Make sure our internal threads are dead before we start tearing down things they're using.
   Dbg::StopJdwp();