Replay queue and IMAP IDLE cleanup
Limit number of times a reply operation is retried before failing, don't ignore replay op errors that aren't remote, ensure IMAP IDLE is only initiated when there are no queued or outstanding commands.
Edited by Michael Gratton