Add a null check to avoid passing null to io_chain_t::push_back
https://github.com/fish-shell/fish-shell/issues/590