pmrep: cleanup stdio on exit to avoid Exception Ignored errors
pmrep: cleanup stdio on exit to avoid Exception Ignored errors

Flush and close stdout and stderr on exit to avoid "Exception Ignored"
errors when the destructor is called with i/o still pending. Also
ignore SIGPIPE to avoid broken pipe exceptions. These issues occur
when pmrep is piped to e.g. /usr/bin/head.

wuliming/pcp,adfernandes/pcp,adfernandes/pcp,wuliming/pcp,wuliming/pcp,wuliming/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,wuliming/pcp,wuliming/pcp,adfernandes/pcp,adfernandes/pcp,wuliming/pcp,wuliming/pcp,adfernandes/pcp