Marshall.dump can't dump an IO

which can be an argument to shell_out which means that we have to
manually dup things before mutating.