refactoring: simplify this code

Thanks to cppcheck for a subtle suggestion.
cppcheck: don't access iterator which was just deleted
cppcheck: remove duplicate check
cppcheck: cleanup
tests: FakeSocket: complain loudly if the expected input is overwritten
tests: FakeSocket: accumulate the mock input from fakeReading()
tests: add support for "expected IMAP errors"
IMAP: don't assert crash on unexpected SEARCH responses

Thanks to Jacopo De Simoi (wilder on IRC) for a bugreport and the error log.
IMAP: prevent a possible assert crash on invalid ESEARCH responses
IMAP: move the handler of UID (E)SEARCH ALL into a single place
FIXME: we don't handle split-out SEARCH responses yet
IMAP: try to work with broken IMAP servers which do not report the UIDNEXT

Thanks to Jacopo De Simoi (wilder on Freenode) for a bugreport and a protocol
trace.

Please note that this is a rather bad situation, the missing UIDNEXT is treated
in the same way as a changed UIDVALIDITY. This *might* be relaxed in future, but
I quite frankly don't trust servers which violate this rule to not change the
immutable data for old UIDs, so this behavior is the best I can come up with for
now.

This means that Trojita will suck hard when talking to Courier.
move Mainpage.dox to the top-level
part of the fix for 312310

CCBUG: 312310
GUI: include server name and the "IMAP" thing in the password prompt

fixes #591
Composer: try to be smart with the type of the next recipient

A usability feature suggested by tss on IRC.
Add settings option for preferring plaintext e-mails over HTML ones