Remove broken strtok_r macro from pthreads and implement real version

The existing strtok_r macro which wraps around strtok will simply not
work since strtok will keep state information internally. Copy
implementation from BSD.
Regenerate automake