Fix a missed assignment and actually check a retval of pthread_cond_wait().

http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg00532.html