Add bin/inbox-consistency-check debugging tool for gmail accounts

Summary:
There are still some differences that haven't been ironed out, and some stuff
isn't implemented (e.g. labels, tags, flags), but the major pieces are here,
and they should already be useful.

This also serves as an example of how to use setuptools entry_points to
make plugins.

Test Plan: manual testing

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D507
Disable failing test for iCloud

Test Plan: Ran the test

Reviewers: charles

Reviewed By: charles

Differential Revision: https://review.inboxapp.com/D500
Don't refuse to schedule syncback actions for accounts in 'connerror' state.

Our ludicrously broken mismanagement of account.sync_state means that accounts
can more or less be in `connerror` for arbitrary reasons at arbitrary times. In
such cases, don't return HTTP 503 when a syncback action is scheduled.
Remove no-longer-valid test.
Fix typos when removing uids from download stack in IMAP sync.

This wasn't actually breaking anything, because we'd just end up trying to
download a UID that wasn't there. But still.
Bound thread length when doing custom threading.

Summary:
This should fix the recursion depth exceeded error we keep seeing. It's also
probably not a good idea to let threads get super long anyways.

Fixes T434.

Test Plan: Unit test added.

Reviewers: khamidou

Reviewed By: khamidou

Maniphest Tasks: T434

Differential Revision: https://review.inboxapp.com/D508
Fix bug in extracting pending UIDs from download stack.
[WIP] Support basic sharding of the mailsync database.

This commit implements experimental sharding of the mailsync database. Details
of the strategy are described in inbox/sharding.py.