osx: fix crash during the tvh_qsort_r()
Merge pull request #407 from dmarion/osx

osx: fix crash during the tvh_qsort_r()