Close imap connection