Avoid waiting for threads to create

Avoid blocking for threads to create in the constructor. This is
safe because the destructor will block until the threads join.

Also avoid creating the thread pool if the image only has one
block.

Get the GC task proccessor to delete the thread pool.

Bug: 116052292
Test: test-art-host
Change-Id: I80399525caa0775eddade73c11e7ebc06e41416a
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d2c915e..a40ffbd 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -349,6 +349,9 @@
   }
 
   if (jit_ != nullptr) {
+    // Wait for the workers to be created since there can't be any threads attaching during
+    // shutdown.
+    jit_->WaitForWorkersToBeCreated();
     // Stop the profile saver thread before marking the runtime as shutting down.
     // The saver will try to dump the profiles before being sopped and that
     // requires holding the mutator lock.