imapx: More improvements to server unseen count tracking
imapx: More improvements to server unseen count tracking

We're using the unseen count as part of our check for when things have
changed on the server (or when QRESYNC has gone wrong), and we need to
rescan all flags. But the server doesn't *tell* us about changes to the
unseen count, like it does for the total count of messages. So we have to
be more careful about tracking it -- especially since the server doesn't
even tell us in SELECT, and we can't issue STATUS to find it out when the
folder is selected.

One place that it was getting out of sync was when the server notified us
about new messages in SELECT, which weren't there when we last issued STATUS.
For messages with a UID equal to or higher than what we thought was the
folder's UIDNEXT, we also have to update the unseen count.

So far, the _only_ time we've hit the QRESYNC sanity check which triggers
a full rescan has been due to this kind of cosmetic unseen count discrepancy.
It's half tempting to disable that check in the QRESYNC sanity check, but
actually it's useful to get it right for the legacy servers too, because it
might cause us to miss updates if we get out of sync.

Distrotech/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,gcampax/evolution-data-server,Distrotech/evolution-data-server,Distrotech/evolution-data-server,Distrotech/evolution-data-server,tintou/evolution-data-server,matzipan/evolution-data-server,tintou/evolution-data-server,tintou/evolution-data-server,gcampax/evolution-data-server,tintou/evolution-data-server,Distrotech/evolution-data-server,matzipan/evolution-data-server,gcampax/evolution-data-server,gcampax/evolution-data-server