login failed with default registry
I am using docker-py (1.8.0) and trying to using login API.

If I don't input `registry='https://index.docker.io/v1/'` .
It will raise exception as following:

```
docker.errors.APIError: 500 Server Error: Internal Server Error ("Unexpected status code [301] :")
```

But I saw https://github.com/docker/docker-py/blob/81edb398ebf7ce5c7ef14aa0739de5329589aabe/docker/api/daemon.py#L52 in source code. Should work with default registry.

diff --git a/docker/api/daemon.py b/docker/api/daemon.py
index a149e5e3..9ebe73c0 100644
--- a/docker/api/daemon.py
+++ b/docker/api/daemon.py
@@ -49,8 +49,6 @@ class DaemonApiMixin(object):
         elif not self._auth_configs:
             self._auth_configs = auth.load_config()
 
-        registry = registry or auth.INDEX_URL
-
         authcfg = auth.resolve_authconfig(self._auth_configs, registry)
         # If we found an existing auth config for this registry and username
         # combination, we can return it immediately unless reauth is requested.
@@ -67,7 +65,7 @@ class DaemonApiMixin(object):
 
         response = self._post_json(self._url('/auth'), data=req_data)
         if response.status_code == 200:
-            self._auth_configs[registry] = req_data
+            self._auth_configs[registry or auth.INDEX_NAME] = req_data
         return self._result(response, json=True)
 
     def ping(self):
['docker/api/daemon.py']