Fixed a bug in the IMAP UTF-7 encoding logic

Thanks to Daniel D'Agostino for spotting this bug.