kth-element in c language with swap pointers and qsort