Use pthread_atfork instead of manual pid tracing