destroy non-fs streams correctly

not every input streams comes with a fd.