io: some fixes to handling of /dev/null when running commands