Close stdin after execution with `docker exec -i`

If you wish to test manually:

Dockerfile:
https://gist.github.com/erikh/765ecedf6bc82ae91ae0 (I just needed something that would reliably hang)

```
docker build -t test .
docker exec -i `docker run -itd test` ls /
```

Second command on master *should* hang after the command runs. This is because the attach logic was expecting another attach later.

The test is not as good as I'd like and I'm open to suggestions on how to make it better.