Move heartbeats emission to eagerly signal bad status.

Summary:
This commits move heartbeats emission after downloading and commiting a
message. If something happen during the download/commit (e.g., anything
related to the connection, IMAP interaction, DB interaction), the retry
mechanism should kick in before emitting heartbeats, thus signal bad
status faster.

Test Plan:
The bugs this commit might uncover cannot be reproduced in a simple manner.
Syncing a bunch of accounts and make sure heartbeats get reported is what we
should check.

Reviewers: emfree, spang

Reviewed By: emfree

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