libjavacore: Implement JNI_OnUnload for icu

Unload ICU when the libjavacore library is unloaded by the DalvikVM.

In some rare cases shutting down and then starting the DalvikVM many
times would cause a memory leak due to the ICU mmaps not being unmapped.

This fixes that issue by unmapping ICU data when the library is
unloaded. It also cleanly resets ICU so we don't need a hack for it
in the art CommonRuntimeTest.

Test: make core-tests  && vogar --classpath out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jack libcore/luni/src/test/java/libcore/icu/ICUTest.java
Bug: 31469648
Change-Id: I8d63d98c8217acd8ae38e982f3aacaaa408bd251
2 files changed