Resolves a race condition between marking messages read and loading/rendering those messages in the frontend. Fixes #942