Move modify_ldt_lock into global lock order.

Mutex modify_ldt_lock was being removed during runtime shutdown while
daemons thread may still detach. Avoid this by placing in global lock
order.
This fixes cts dalvik vm-tests-tf that hang on some x86 devices.

By irogers: also, tidy global locks to agree with enum constants and
add extra verification that the global annotalysis order agrees with
the LockLevel order. Bumped the oat version and moved the locks as
LockLevel additions previously caused entrypoints to be moved. Make
unattached lock not handle the default mutex level case by moving the
allocated thread ids lock into the global order.

Change-Id: I9d03f19d44ea254accf0ceae8022563c77f7a02f
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
diff --git a/runtime/thread_list.h b/runtime/thread_list.h
index a574340..d46987a 100644
--- a/runtime/thread_list.h
+++ b/runtime/thread_list.h
@@ -132,7 +132,7 @@
 
  private:
   uint32_t AllocThreadId(Thread* self);
-  void ReleaseThreadId(Thread* self, uint32_t id) LOCKS_EXCLUDED(allocated_ids_lock_);
+  void ReleaseThreadId(Thread* self, uint32_t id) LOCKS_EXCLUDED(Locks::allocated_thread_ids_lock_);
 
   bool Contains(Thread* thread) EXCLUSIVE_LOCKS_REQUIRED(Locks::thread_list_lock_);
   bool Contains(pid_t tid) EXCLUSIVE_LOCKS_REQUIRED(Locks::thread_list_lock_);
@@ -151,8 +151,7 @@
       LOCKS_EXCLUDED(Locks::thread_list_lock_,
                      Locks::thread_suspend_count_lock_);
 
-  mutable Mutex allocated_ids_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
-  std::bitset<kMaxThreadId> allocated_ids_ GUARDED_BY(allocated_ids_lock_);
+  std::bitset<kMaxThreadId> allocated_ids_ GUARDED_BY(Locks::allocated_thread_ids_lock_);
 
   // The actual list of all threads.
   std::list<Thread*> list_ GUARDED_BY(Locks::thread_list_lock_);