Simulate a deadlock using pthreads in C