Fixed IMAP connection die error.
Follow up from I5fddd3f56e971a9c845727f77f5a0763c1a08e67

Change-Id: I45288e77d186b56ec5360a8d9fc47bfcce2a7c4a