Producer/Consumer problem with pthreads