fix pthread_mutex test: unlock before destroying a mutex