Retain session when IMAP and SMTP operations are running. Fixed #127, fixed #128.