s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code