Refactor the APEX package activation/deactivation logic in `otapreopt_chroot`.

This is in prevision of reusing the package deactivation logic as a
clean-up step upon Bionic bind-mounting failure.

Test: m otapreopt_chroot
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120266448
Change-Id: I17b2d57252af7aca1fc27b4c051d6cc9d373c223
1 file changed