qsort in-place version in python