Get JNIEnv in thread-aware manner.
Merge pull request #171 from LoomSDK/BJG-FixJNIEnv

Get JNIEnv in thread-aware manner.