merge-ort: use STABLE_QSORT instead of QSORT where required