Hold a ClassLoader reference in NativeAllocationRegistry.

So that the native library isn't unloaded before we have a chance to
call the freeFunction.

Bug: 28406866

(cherry picked from commit 111fdf10801861427f59e42c34c40d5df484053b)

Change-Id: I80c15400335edfc31de0bb6e06ed514ac4ea1d4d
6 files changed