[lib] Add a function for sanitizing the state on identity actions
Summary:
issue: ENG-6424
We want to reset the state to default on identity login / logout / delete account. We want to do it in one place, to reduce the risk of accidentally not clearing some state, and leaking data.
We want to have a "white list" of fields that are not supposed to be wiped. For example commServicesAccessToken, loadingStatuses, notifPermissionAlertInfo, lifecycleState etc.
Test Plan: ran the provided test
Reviewers: michal, kamil, ginsu, ashoat
Reviewed By: ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10801