[identity] Make device list transactions more flexible
Summary:
I need the "transaction wrapper" to:
- Make the additional DB operation optional
- Return the resulting device list representation
Depends on D10797
Test Plan: Ran device list integration tests and seen no regressions
Reviewers: varun, michal
Reviewed By: varun
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10798