Fix JDWP ObjectRegistry lock ordering.

Also make debugging lock ordering violations nicer by using our
LockLevel operator<<.

Change-Id: Ic15ebe70363a90a09f6491bd5c336a604e9d6c48
diff --git a/src/thread-inl.h b/src/thread-inl.h
index cf92a1c..414b8d8 100644
--- a/src/thread-inl.h
+++ b/src/thread-inl.h
@@ -41,7 +41,7 @@
   CHECK_EQ(0u, no_thread_suspension_) << last_no_thread_suspension_cause_;
   if (check_locks) {
     bool bad_mutexes_held = false;
-    for (int i = kMaxMutexLevel; i >= 0; --i) {
+    for (int i = kLockLevelCount - 1; i >= 0; --i) {
       // We expect no locks except the mutator_lock_.
       if (i != kMutatorLock) {
         BaseMutex* held_mutex = GetHeldMutex(static_cast<LockLevel>(i));