Do not exit from SIGPIPE as it is creating more problems than it solves