use the correct JNIEnv for the thread. This resolves an issue with the jvm crashing when async methods are called. [issue #139]