Set alarm for retries with exponential backoff.

If the first retries don't work, we want to retry later using the
AlarmManager, which will schedule the retry when convenient.
Currently it just retries every 5 seconds (that's bad). This
change includes:
- Add key to preferences to save the current retry interval
- Add helper methods to construct proper pending intent and cancel
  existing retries
- Remove the "undelete"/"unread" since we will be retrying uploads as
  well as downloads.
Also we don't want to make a new network request if the first one
succeeded, we just want to retry the IMAP connection.
There's also a fix here for a bug where the local voicemails were not
indicated as "read" so there would be unnecessary updates to the
voicemail provider.

Bug: 21978479

Change-Id: I18c5e2d0b7920540ded74b09f63eb94fdd959f43
8 files changed