Sync qsort.c with userland r318515.
(Note that MIN macro is removed in favor of sys/param.h's version).
PR: 213922