[identity] Extract device list verification to separate func
Summary:
Some refactor - Extracted verification logic to the caller of apply_device_list_update() to give flexibility of giving different verification criteria for different scenarios (e.g. we want it to be able to replace device list with a singleton during backup restore, but not when primary device is adding a new device)
Depends on D11685
Test Plan:
- Manually called UpdateDeviceList RPC. Behaves the same before and after this diff
- Valid device list (1 device added)
- Invalid update (2 devices added)
- Invalid update (no changes)
- Invalid update (device removed)
- Integration test still passes
Reviewers: varun
Reviewed By: varun
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11686