Periodically refresh IMAP flags for those servers that don't support CONDSTORE

Summary:
Christine,

I integrated the changes we talked about yesterday. Here's what I think you should take a look at first:

- I've decided to spawn a new greenlet to update IMAP flags during a full sync. I thought it would be cleaner this way (imap.py:561). To do this I defined a new function "imap_check_flags" which was largely copy-pasted from another one. Tell me if you think there's stuff which should be abstracted away.

- IMAP updates are limited to the highest "refresh_flags_max" UIDs (2000 by default, but this is a constructor parameter). I must say I haven't found a better variable name so I'm open to suggestions.

Test Plan: Ran a smoke test. Triggered a full sync and paused the program with a debugger. Checked that the fields where updated in the db.

Reviewers: spang

Reviewed By: spang

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