Fix attach exit on darwin

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Merge pull request #4603 from creack/fix_osx_attach

Fix OSX attach exit issue