Add a fork safety test
Add a `check_inherited_socket` option

With this option the pid check used to detect
fd leaking can be disabled.