Quicksort with thread pool in C