Fixed a few places we weren't closing the IMAP connection before we exit.