Cleanup SIGPIPE handling code