Quicksort implementation in C