Port t/015-sort_external.t to C