IMAP: Fixed THREAD .. INTHREAD crashing. Also cleaned up the code a bit.
IMAP: Fixed THREAD .. INTHREAD crashing. Also cleaned up the code a bit.

LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot