Switch to indirect references rather than direct pointers.

This also required a bit of fiddling to break cyclic dependencies,
now "jni_internal.h" needs Mutex from "thread.h".

Change-Id: I1d6fb2d801c190f72255f5e447a0a8a65cc3e673
diff --git a/src/thread.cc b/src/thread.cc
index 1001b29..eb7a4f7 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -9,6 +9,7 @@
 #include <list>
 
 #include "class_linker.h"
+#include "jni_internal.h"
 #include "object.h"
 #include "runtime.h"
 #include "utils.h"