resolve jni env multithread issue, fix activecontext bug