mescc: Mes C Library: Fix qsort to support duplicate entries.