Prevent local reference table overflows
Prevent local reference table overflows

If we're grabbing references to many strings in a loop, we have to
remove our local references so we don't overflow the VM's local
reference table.

Also, use env->ExceptionCheck() instead of checking for NULL value
returns on trying to allocate new items.

Bug: 2663816
Change-Id: I9cb5e17f6181dbb2f2c03d53841b2f5d8ab10f68

xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base