Properly stop imap at logout