Linux's list_sort() is intended to be stable, but linuxkpi implemented
it as a wrapper around qsort(), which is not. This used to work because
our qsort() had a bug that effectively turned it into insertion sort,
but this is no longer the case. Replace the qsort() call with an inline
implementation of insertion sort.
MFC after: 1 week