open_istream(): do not dereference NULL in the error case