Extensions to check JNI.

Ensure critical lock isn't held when returning from a down-call.
Log a warning if the critical lock is held for a significant period of
time.
Refactor JNIEnvExt to be a class rather than a struct.

Test: mma test-art-host

Change-Id: I4d149cb04d3a7308a22b92b196e51e2f1ae17ede
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 7324dff..e88ed68 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -959,7 +959,7 @@
   }
   if (self != nullptr) {
     JNIEnvExt* const env = self->GetJniEnv();
-    if (UNLIKELY(env != nullptr && env->runtime_deleted)) {
+    if (UNLIKELY(env != nullptr && env->IsRuntimeDeleted())) {
       CHECK(self->IsDaemon());
       // If the runtime has been deleted, then we cannot proceed. Just sleep forever. This may
       // occur for user daemon threads that get a spurious wakeup. This occurs for test 132 with