Remove dependency on jniGetNonMovableArrayElements.

jniGetNonMovableArrayElements is not safe and is going to be deleted.

Change-Id: I6daae1e4ac9e01ca593cda522fdbeb774eef1eff
(cherry picked from commit 75a5038849cecf38aba72721272ff07cca09501f)
Fix whitespace issues after casts.

Change-Id: Ief3e50fbedd193e22509aac783f16ba1288908de
Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf.

Since VMRuntime.newNonMovableArray and VMRuntime.addressOf are java
methods implemented in Native, they don't necessarily return NULL
when an exception is thrown. Checking the exception instead of the
return value fixes errors which may occur if the runtime returns
garbage when an exception is pending.

Bug: 11971220
Change-Id: I70478834c9f14cc5d9e666e1e174d3fd09269719