no need to synchronize thread local value
replace rt.qsort with libc wrapper
use reentrant qsort_r where available

- this avoids one TLS access per comparison
Merge pull request #427 from dawgfoto/qsort2

replace rt.qsort with libc wrapper