Update a thread's folders when we detect deleted ImapUids.

Summary:
This means that, for example, we remove the 'inbox' tag from a thread if it's
removed from the Gmail inbox during an initial sync.

We don't yet deal with the case that a message is deleted entirely (e.g., from
both Inbox and All Mail on Gmail).

Fixes T271.

Test Plan: Start a sync and archive some mail from the top of the inbox.

Reviewers: spang

Reviewed By: spang

Maniphest Tasks: T271

Differential Revision: https://review.inboxapp.com/D312