Fix segfault seen in BUG #9808.

On certain platforms, the comparison operator is called for sorting with
same arguments. We skipped that case in our "assert". Fixed that.

Change-Id: I8fdc496d2b078878dca21eca64b8b8ce3547285a
Merge topic 'remove_duplicate_tiff_readers' into next

f6dc4055 Fix segfault seen in BUG #9808.