The gHardy man pages specify the return type of ptsname_r to be char*, but the
return value to be 0 on success, negative on error and the gHardy stdlib.h
defines extern int ptsname_r(...).
Busybox telnetd fails to run successfully without this change.
This reverts commit 754c178ae5.
Turns out we don't need it afterall (needed a stable sort anyways).
So, we'll make that change in the dev branch instead.
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.