avoid crash on stupid but allowable usage of pthread_mutex_unlock