Have stdin closed by default, can be left open with --leave-stdin-open. Add e2e tests for the behavior.