Use pthread_atfork() and variants to detect fork
master now holds the 3.4.0 release