Fix Race when killing the daemon

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

Fix Race when killing the daemon