Note that pthread_once() isn't threadsafe.
Implement pthread_mutex_destroy().