Implement read-and-flush operation for flat-file based message storage
Summary: Implements operation that reads all messages that were written since last call to this method, and clears main storage content if semaphore acquisition succeded. It also reads and deletes all random files with single notifications.
Test Plan: Use this method in AppDelegate to read messages written by NotificationService (see test plan for parent diff). Ensure all messages sent via web client are seen in the debugger where AppDelegate calls this method. Once it is done. Launch debugger again (but do not send any notifications). Ensure that no messages are seen this time (this checks for successful flush operation).
Reviewers: palys-swm, varun, karol-bisztyga
Reviewed By: palys-swm
Subscribers: ashoat, Adrian, atul, yayabosh
Differential Revision: https://phab.comm.dev/D4394