Fix issue with Thread.setName hanging after Thread.start

When suspending a thread by peer the invariant that only attached threads are
suspended must be maintained. Add a ThreadList::Contains check which requires
making this method non-static.
Add some extra thread logging.

Bug: 17302037

(cherry picked from commit 37c16453a92bbf1a47f042000318a1b60381017d)

Change-Id: I51832785d4b4b431e035318e75635f442e89a1fb
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index ffd15f6..9136f9f 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -2281,8 +2281,9 @@
   // trying to suspend this one.
   MutexLock mu(self, *Locks::thread_list_suspend_thread_lock_);
   bool timed_out;
-  Thread* thread = ThreadList::SuspendThreadByPeer(peer.get(), request_suspension, true,
-                                                   &timed_out);
+  ThreadList* thread_list = Runtime::Current()->GetThreadList();
+  Thread* thread = thread_list->SuspendThreadByPeer(peer.get(), request_suspension, true,
+                                                    &timed_out);
   if (thread != NULL) {
     return JDWP::ERR_NONE;
   } else if (timed_out) {
@@ -3171,8 +3172,8 @@
         {
           // Take suspend thread lock to avoid races with threads trying to suspend this one.
           MutexLock mu(soa.Self(), *Locks::thread_list_suspend_thread_lock_);
-          suspended_thread = ThreadList::SuspendThreadByPeer(thread_peer, true, true,
-                                                             &timed_out);
+          ThreadList* thread_list = Runtime::Current()->GetThreadList();
+          suspended_thread = thread_list->SuspendThreadByPeer(thread_peer, true, true, &timed_out);
         }
         CHECK_EQ(soa.Self()->TransitionFromSuspendedToRunnable(), kWaitingForDebuggerSuspension);
         if (suspended_thread == nullptr) {