Fix SIGPIPE handling for sub-processes (thanks to @planar)