Fix detection of pthread_atfork function.