Fix sorting messages by size on servers without SORT capability (#1489981)