Replace custom init sync with standard pthread_once