From 1003d442 and 074338f1 and e4989231 (to avoid multiple pthread_at_fork) in !202
If we use pthread_at_fork, ssh and fork-like codes start working. Also we don't need to protect fds.