osx: fix crash during the tvh_qsort_r()