Fixed IMAP logout prematurely issue