Preserve JNI bindings across structural redefinition

We were incorrectly clearing the JNI bindings of native methods on
classes which are structurally redefined. This can cause major issues
with code which uses JNIEnv::RegisterNatives to setup native methods.
This change copies the required information from the old to the new
method. Since the RegisterNatives method can be run asynchronously we
need to wait until we gain the final SuspendAll to actually read and
copy the registration.

Test: ./test.py --host
Bug: 158476592

Change-Id: Ie8a33234bb852a46e5275502c842553637c8a2c6
11 files changed