only pass stdin to hijack when needed
Merge pull request #2399 from dotcloud/fix_race_stdin_cli

Only pass stdin to hijack when needed