Add qsort_r() implementation to the C library.

NOTE: This replaces qsort.c with the FreeBSD version. While
      the patch changes the source, it should not alter the
      implementation that should use the exact same algorithm.
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index acfe694..4f18833 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -101,6 +101,7 @@
 	int (*compar)(const void *, const void *));
 
 extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+extern void qsort_r(void *a, size_t n, size_t es, void *thunk, int (*)(void *, const void *, const void *));
 
 extern long jrand48(unsigned short *);
 extern long mrand48(void);