Applied the POP3 fix from commit 2897ce7d so imap_dophase_done() isn't called if imap_multi_statemach() fails.