Close ApkAssets in PackageParser

Immediately closes ApkAssets to free up some memory during package
parsing/install process.

This is used instead of implementing AutoCloseable because of
complexities with AssetManager and tracking assets opened
outside of the ApkAssets.java class.

Explained more in b/72056911.

Test: manually booted emulator; closing ApkAssets is used at
boot in PackageParser#parseApkLiteInner
Test: adb install test.apk && sleep 5 && adb uninstall test.package
&& sleep 1 && (adb shell lsof | grep "test.package") prints no
system_server references

Bug: 130182148

Change-Id: Ia471d7065e65bd39b535309de6c6da7ec35bdf12
3 files changed