Don't call Allocation.createTyped when synchronized

There is a deadlock which can occur since Allocation.createTyped
calls registerNativeAllocation which may run finalizers. When the
finalizers are run, one of them may add an element back to the
cache. So if we do this while being synchronized on this cache,
we deadlock.

Bug: 17447556

Change-Id: I15755e6991dcf82ebfe94299c26456ee2e60ad25
1 file changed