move pthread_mutex_init() into platform code