Fix a potential crash in ExternalCommandListener::CommandPipeThread

refs #6589