jni: fixed local ref leak