Fix calls to JNI methods with pending exception in calljavafunction.