fix race condition in pcu_thread_init

occasionally this would fail
with the "cannot find thread" message.
It was probably because there is
no guarantee that pthread_create
will write the id into global_threads
before running the function, and
if the function is quick it may
look at the array before its own
id gets written into it.
fortunately, we can just pass the id
as the previously unused void* argument.
forget pthread_barrier, always use custom barrier

we keep finding machines that don't have
pthread_barrier, and I'm tired of #ifdef.
The custom code seems reasonable, and
now that its on our side we can replace
it with better things if that becomes
necessary.