[WO-429] Fix race condition in IMAP client that could lead to currupted imap cache and duplicates in the UI