fixed implementation error in pthread_once