Check JNI versions handed to JNI and JII functions.

Bug: https://code.google.com/p/android/issues/detail?id=58012
Change-Id: I7b062564573107df54f9e8d71df0e1583d83d421
Not all shared libraries have a JNI_OnLoad.

Change-Id: Iace5d33cbeafbf8b840bebb4bb709e32053f142d
Returning JNI_ERR from JNI_OnLoad is still an error!

Fixes a bug introduced in the previous patch.

Change-Id: I34ea63d323a0125c3c4ae140a2ae9b8e9ed3e1df