Parallel merge sort using pthreads