Fix occasional deadlock caused by checkpoint root marking.

There was a race where a new worker thread would attach during the
checkpoint. This caused the thread to wait since suspend count != 0.
But when we decremented the suspend count, we did not broadcast to
the resume condition.

Added a create peer parameter to Thread::Attach and
AttachCurrentThread. This is used by the threadpool since we don't
need a java peer for worker threads.

Change-Id: I632926b5a6b52eeb0684b6e1dcbf3db42ba3d35c
diff --git a/src/thread_pool.cc b/src/thread_pool.cc
index 26c83d2..3ded42a 100644
--- a/src/thread_pool.cc
+++ b/src/thread_pool.cc
@@ -35,7 +35,7 @@
 void* ThreadPoolWorker::Callback(void* arg) {
   ThreadPoolWorker* worker = reinterpret_cast<ThreadPoolWorker*>(arg);
   Runtime* runtime = Runtime::Current();
-  CHECK(runtime->AttachCurrentThread(worker->name_.c_str(), true, NULL));
+  CHECK(runtime->AttachCurrentThread(worker->name_.c_str(), true, NULL, false));
   // Do work until its time to shut down.
   worker->Run();
   runtime->DetachCurrentThread();