Revert "Revert some flaky unloading"

This reverts commit 73ad16e0193866d36dbd4088ac77fa5d4ceec334.

With this code it is possible that during testing we will race the
final shutdown of some threads (i.e. returning to thread_start after
signaling thread has been finished) with the unloading of libart.so by
libnativehelper. This could cause crashes. By ensuring that libart.so
code is not unloaded in libnativehelper we fix the issue with this
patch.

Bug: 28406866

Change-Id: Ic67118c2a4e743941402b17b6bbfe4cce441f68f
2 files changed