[lib] Ensure messageStore.threads entry for each message from SQLite
Summary: See 2b here. This diff makes sure that if a message is present in SQLite, we have a messageStore.threads entry for its corresponding thread.
Test Plan: Confirm that issue in ENG-2275 no longer repros
Reviewers: atul, tomek
Reviewed By: atul
Differential Revision: https://phab.comm.dev/D5671