[CommCoreModule] implement method to persist olm account
Summary:
This code will be re-used a lot in methods introduced later in the stack - creating a separate function.
In all cases, this method will be called from a task invoked on the crypto thread, since tasks are sequential and invoked in order on one thread it should result in the same order on the database thread so there is no chance to override/miss some updates on crypto account.
Depends on D10370
Test Plan: Build the app, the rest is tested later in the stack.
Reviewers: marcin, varun, michal
Reviewed By: marcin
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10371