Replace free calls to the pthread mutex lock, unlock, and trylock
functions with calls to the error checked wrapper functions.  This
ensures that all mutex operations are checked in debug builds.

Change-Id: I4a5f181e025a2974f3325bcd9efa861eb6a92978
diff --git a/vm/Thread.h b/vm/Thread.h
index e2af253..082c7d3 100644
--- a/vm/Thread.h
+++ b/vm/Thread.h
@@ -22,6 +22,7 @@
 
 #include "jni.h"
 
+#include <errno.h>
 #include <cutils/sched_policy.h>
 
 
@@ -387,7 +388,9 @@
  */
 INLINE int dvmTryLockMutex(pthread_mutex_t* pMutex)
 {
-    return pthread_mutex_trylock(pMutex);
+    int cc = pthread_mutex_trylock(pMutex);
+    assert(cc == 0 || cc == EBUSY);
+    return cc;
 }
 
 /*