Move apex sessions directory to /metadata

Make use of the existing /metadata/apex/sessions to store
apex sessions. This means that session state will persist
and will not be affected by checkpointing.

Extend the logic for reverting in the case of checkpointing
by reverting all non-finalized sessions. This is because when
a session is activated before being reverted at a later stage,
the state will not be STAGED as before. Added a test to
ApexRollbackTests for this scenario.

Add field to ApexSessionInfo for use in testing, and future use
in logging.

Test: atest apex_rollback_tests
Test: atest apexservice_test
Test: Manual: stage sessions on old build, patch this CL
      and ensure sessions are migrated correctly
Bug: 138782888

Change-Id: I2ffb2dff2bfdbd2b3a9ea7b6c43c540e38da77d6
12 files changed