Add back the work-arounds for broken apps that assume JNI uses direct references.

Note that we'll need to add support for this to jni_compiler too.

Change-Id: I7e31ab4314ba913cde4629544addd0aad9a89b3b
diff --git a/src/jni_internal.h b/src/jni_internal.h
index a4362d3..05df3e4 100644
--- a/src/jni_internal.h
+++ b/src/jni_internal.h
@@ -49,6 +49,9 @@
   bool verbose_jni;
   bool force_copy;
 
+  // Used to provide compatibility for apps that assumed direct references.
+  bool work_around_app_jni_bugs;
+
   // Used to hold references to pinned primitive arrays.
   Mutex* pins_lock;
   ReferenceTable pin_table;
@@ -75,7 +78,9 @@
   Thread* self;
   JavaVMExt* vm;
 
+  // Frequently-accessed fields cached from JavaVM.
   bool check_jni;
+  bool work_around_app_jni_bugs;
 
   // How many nested "critical" JNI calls are we in?
   int critical;