Revert "Revert "Log the apk optimization state in the MetricsLogger""

This reverts commit 203a9ab7665787c94f7d0711a1ad172588070aa6.

Reason for revert: Fix the original issue. There was a race with the
cleanup method which was resetting the app record to null.

Test: manual, adb logcat -b events | grep sysui_multi_action
      repeat steps from bugreport reporting the crash
Bug: 73102540

Change-Id: I6d9c6110a9d5dadeb9d4361592711d63563c958a
6 files changed