Add parentKey and new flags to existing and new mailboxes

* Created utility that sets a mailbox's flags and sets the parent key of
  any children
* Created a wrapper that calls the above for all mailboxes with an uninitialized
  parent key (this is the "upgrade" case from earlier EmailProvider version
  that didn't have the column
* Update FolderSyncParser to call the wrapper after any additions and also
  to call the utility for all parent mailboxes affected by folder changes
  sent by the server (for delete, the parent; for add, the parent, unless
  top-level; for change, if the parent changed, the old and new parents)
* Add utilities to flag the start/end of folder sync, so that we can fix up
  mailbox parent key/flags if the process was interrupted
* Add a check for mailbox consistency each time around the folder sync loop
  and the ping loop
* Unit tests for various cases; at the moment, folder changes are simulated
  via direct calls to the wrapper/utility
* TODO: Use FolderSyncParser for unit test cases instead of the simulation
* TODO: Unit tests for start/end/check utilities

Change-Id: I556f44724ed4f6f9cff32d7bc084218ffcbbae5f
6 files changed