Fix some JDWP bugs related to locking and getting statics.

Gave all JDWP locks an explicit level to prevent them from using the
default. Also made sure the class of the field would be passed to
GetObject instead of NULL for statics. There's still a number of test
failures in JDWP.

Change-Id: I6134be2a99d4a0968f9719f620864a3c176b4a58
diff --git a/src/jdwp/jdwp_main.cc b/src/jdwp/jdwp_main.cc
index 5e368e7..0691515 100644
--- a/src/jdwp/jdwp_main.cc
+++ b/src/jdwp/jdwp_main.cc
@@ -87,7 +87,7 @@
 
 JdwpState::JdwpState(const JdwpOptions* options)
     : options_(options),
-      thread_start_lock_("JDWP thread start lock"),
+      thread_start_lock_("JDWP thread start lock", kJdwpStartLock),
       thread_start_cond_("JDWP thread start condition variable", thread_start_lock_),
       pthread_(0),
       thread_(NULL),
@@ -96,7 +96,7 @@
       run(false),
       transport_(NULL),
       netState(NULL),
-      attach_lock_("JDWP attach lock"),
+      attach_lock_("JDWP attach lock", kJdwpAttachLock),
       attach_cond_("JDWP attach condition variable", attach_lock_),
       last_activity_time_ms_(0),
       serial_lock_("JDWP serial lock", kJdwpSerialLock),
@@ -161,7 +161,6 @@
       state->thread_start_cond_.Wait(self);
     } else {
       {
-        MutexLock attach_locker(self, state->attach_lock_);
         /*
          * We have bound to a port, or are trying to connect outbound to a
          * debugger.  Create the JDWP thread and let it continue the mission.
@@ -184,6 +183,7 @@
          */
         {
           ScopedThreadStateChange tsc(self, kWaitingForDebuggerToAttach);
+          MutexLock attach_locker(self, state->attach_lock_);
           state->attach_cond_.Wait(self);
         }
       }