Iterative quicksort implementation in C