Fix TestCmdKill by closing the pipe before waiting on the container

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Merge pull request #4357 from creack/fix_TestCmdKill

Fix TestCmdKill by closing the pipe before waiting on the container