Make sure that closing stdin of a remotely executing command sends the EOF

Here's an example:

```python
fin, fout, ferr= client.exec_command('python')
fin.write('print "foo"')
fin.close()
# without this patch the following line will hang up
# because remote python is still waiting for EOF on stdin
assert fout.read() == 'foo\n'
```