Use ScopedLocalRef in InputEvent jni function

This CL updates some jni functions that manipulate Key and Motion events
to use ScopedLocalRef instead of plain jobject for better life-cycle
tracking.

Test: presubmit
Bug: 324375527
Change-Id: I154b0606d3c0912f0df7a890faf7246b575863f5
9 files changed