Try to fix build on Linux.

* Linux is the only one of our supported build hosts to not have
mergesort. Provide an implementation that calls qsort, since the qsort
implementation in the glibc used by Linux uses a mergesort (!) for small
arrays.