Add the -Xcheck:jni option.

And make sure the boolean is available in every JNIEnv, so we
don't have to look it up via Runtime and JavaVM every time we
need to use it.

Change-Id: I2d4b5d04ded196e7c7602406d854bb35227d767a
diff --git a/src/thread.h b/src/thread.h
index 8bde370..de5893e 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -118,7 +118,7 @@
   static Thread* Create(size_t stack_size);
 
   // Creates a new thread from the calling thread.
-  static Thread* Attach();
+  static Thread* Attach(const Runtime* runtime);
 
   static Thread* Current() {
     void* thread = pthread_getspecific(Thread::pthread_key_self_);