deno is massively caring itself for handling stdout, stdin and stderr. you cannot tell, what is does, when stdout is closed and gives an error upon usage.
and what's maybe of even more inportance: you code above does not close the stdout and stderr, but stdin and whatever input #2 may be.
to close stdout, you need to `exec 1>&-´ instead of `exec <&-´ ... is that a typo in your question or did you indeed close input stream instead of output ?