Fix crash on error paths from GenericJNI trampoline.

Test: Added a regression test to 178-app-image-native-method
Test: testrunner.py --host --optimizing -t 178-app-image-native-method
Bug: 181736463
Change-Id: Ib98d6d58ce1fb8287c32f88fda0f83b7e21ef42d
2 files changed