Sanity checks
No need to check UIDNEXT at all here anymore.

Possible fix for Bug: 12239
Avoid undefined index warnings.
Add imap folder tests.