check pthread_mutex_destroy, pthread_cond_destroy return codes

Signed-off-by: Colin McCabe <cmccabe@alumni.cmu.edu>
check mutex or condition variable init and destroy

If pthread_mutex_init, pthread_mutex_destroy, pthread_cond_init, or
pthread_cond_destroy fails, log a message.  These functions very rarely
fail.  In the case of the destroy functions, they should never fail in a
valid program.  It is easy for programmers to forget to check these.

Signed-off-by: Colin McCabe <cmccabe@alumni.cmu.edu>