Commands with input set to none would not have stdin closed

This meant if such command would read from its stdin, it would hang.

Fixes #1081