cutils: Added qsort_r_compat