Attaching a listener on stdin for 'error' prevents crashing