Exit from `docker login` on SIGTERM and SIGINT.

Fixes #1299.
Use a more idiomatic syntax to capture the exit.
Allow to generate signals when termios is in raw mode.
Sort APIImages by most recent creation date.

Fixes #985.
Merge branch 'master' into login_signal

* master: (54 commits)
  Return JSONError for HTTPResponse error
  Fix TestEnv
  Revert "Bind daemon to 0.0.0.0 in Vagrant. Fixes #1304"
  Add unit tests for build no cache
  Add no cache for docker build
  Move note about officially supported kernel
  Solved the logo being squished in Safari
  Add hostname to the container environment.
  fix same issue in api.go
  improve tests
  Return registy status code in error
  update http://get.docker.io/latest
  Add check that the request is good
  fix tests about refactor checksums
  add ufw doc
  Fixed a couple of minor syntax errors.
  Updated the description of run -d
  Make sure the index also receives the checksums
  Switch json/payload order
  Remove unused parameter
  ...
Stop making a raw terminal to ask for registry login credentials.

It only disables echo asking for the password and lets the terminal to handle everything else.
It fixes #1392 since blank spaces are not discarded as they did before.
It also cleans the login code a little bit to improve readability.
Exit if there is any error reading from stdin.
Print a new line after getting the password from stdin.
Assume that if VAGRANT_DEFAULT_PROVIDER is set we shouldn't install vbox tools
Add USER instruction
Don't read from stdout in hijack unless attached. Fixes #1503
fix can't connect message
 with socket
Update readme with dependencies for building

Closes #915
Adding direct reference to contribution guidelines
add loading message
Add instructions for creating and using the docker group
remove extraneous step and stupid whitespace
registry: removing opaqueRequest
Merge pull request #1473 from shin-/978-opaque-v2

Reworking opaque requests in registry module
Merge pull request #1569 from TylerBrock/patch-1

Add instructions for creating and using the docker group