Exit from `docker login` on SIGTERM and SIGINT.

This should allow to capture an interruption signal and exit when the login command is waiting for the credentials.

I'm completely new to docker's source code, so this might be incomplete. I'd really appreciate some :eyes: on it.

Fixes #1299.