Check pthread_mutex_unlock for errors