imaputil: make uid_sequence sort all items to improve collapsing
imaputil: make uid_sequence sort all items to improve collapsing

To preserve previous behavior and save a few CPU cycles, we were not sorting UID
lists and only collapsed them if they were alreay sorted.  Vincent pointed out
that this is not always the case and unsorted lists lead to non-optimally
collapsing.

Force lists to numeric types and sort them before collapsing.

Reported-by: Beffara <0bd41a4959f4cb6965f288835fc67b4514b93f43@ens-lyon.fr>
Signed-off-by: Sebastian Spaeth <98dcb2717ddae152d5b359c6ea97e4fe34a29d4c@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <347709267ddd1958560c4c317ea3fd613f10a719@laposte.net>

frioux/offlineimap,frioux/offlineimap