Stop reading stdin when client sends empty stdin

Otherwise any attempts to signal EOF are just no-ops.