Fix logs with tty
add CmdLogs test
Merge pull request #2499 from dotcloud/2414-logs_tty-fix

Fix logs with tty