sortperm: use stable sort (MergeSort) by default [fix #4369]