Make sure we close sockets on exec.

This ensures we don't leak file descriptors to child processes
(inferior, or slave worker for platform mode).