JNI: Fixed stale reference errors in input-android