Fix messages list sorting with THREAD=REFS

Conflicts:

	CHANGELOG