<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Explain the problem briefly below -->
docker_login creates an invalid json as output, when the file not existed before. 

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
docker_login

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.8.6
  config file = /c/Users/<user>/Documents/Git/deployment/ansible/ansible.cfg
  configured module search path = ['/home/<user>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Oct  7 2019, 12:59:55) [GCC 8.3.0]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
ANSIBLE_PIPELINING(/c/Users/<user>/Documents/Git/deployment/ansible/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/c/Users/<user>/Documents/Git/deployment/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=30m
DEFAULT_HASH_BEHAVIOUR(/c/Users/<user>/Documents/Git/deployment/ansible/ansible.cfg) = merge
DEFAULT_LOG_PATH(/c/Users/<user>/Documents/Git/deployment/ansible/ansible.cfg) = /tmp/ansible.log
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/<user>/.ansible_vault_pass.txt
```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
Ubunutu 18.04 in WSL
Target OS: coreos with pypy and docker==4.1.0
```
Python 3.6.9 (5da45ced70e515f94686be0df47c59abd1348ebc, Oct 17 2019, 22:59:56)
[PyPy 7.2.0 with GCC 8.2.0]
```

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
The config.json must not exists. Then execute the docker_login module.
<!--- Paste example playbooks or commands between quotes below -->
```yaml
- name: Login into private registry
  docker_login:
    config_path: /home/<os-user>/.docker/config.json
    registry_url: "{{ docker.registry.url }}"
    email: "{{ docker.registry.email }}"
    username: "{{ docker.registry.username }}"
    password: "{{ docker.registry.password }}"
```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
A valid config.json is created

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
The following invalid json is created:
I replaced the actual values with placeholders, the values itself are correct
```json
{
     "auths": {}
}        "<registry-url>": {
               "auth": "<auth>",
               "email": "<email>"
          }
     }
}
```

<!--- Paste verbatim command output between quotes -->
```paste below
TASK [docker : Login into private registry] ********************************************************************************************************************************************************************task path: /c/Users/<user>/Documents/Git/deployment/ansible/roles/docker/tasks/docker_private_registry.yml:10
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/cloud/docker/docker_login.py
Pipelining is enabled.
<ip> ESTABLISH SSH CONNECTION FOR USER: <os-user>
<ip> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=30m -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="<os-user>"' -o ConnectTimeout=10 -o ControlPath=/home/<user>/.ansible/cp/8c7df41a0d 178.22.69.100 '/bin/sh -c '"'"'/opt/bin/python && sleep 0'"'"''
<ip> (0, b'\n{"changed": true, "login_result": {"IdentityToken": "", "Status": "Login Succeeded"}, "invocation": {"module_args": {"config_path": "/home/<os-user>/.docker/config.json", "registry_url": "<registry>", "email": "<email>", "username": "<user>", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "debug": true, "docker_host": "unix://var/run/docker.sock", "tls_hostname": "localhost", "api_version": "auto", "timeout": 60, "tls": false, "validate_certs": false, "reauthorize": false, "state": "present", "ca_cert": null, "client_cert": null, "client_key": null, "ssl_version": null}}}\n', b'OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017\r\ndebug1: Reading configuration data /home/<user>/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 10163\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
changed: [sandbox-oh-01] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "api_version": "auto",
            "ca_cert": null,
            "client_cert": null,
            "client_key": null,
            "config_path": "/home/core/.docker/config.json",
            "debug": true,
            "docker_host": "unix://var/run/docker.sock",
            "email": "<email>",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "reauthorize": false,
            "registry_url": "<registry>",
            "ssl_version": null,
            "state": "present",
            "timeout": 60,
            "tls": false,
            "tls_hostname": "localhost",
            "username": "<user>",
            "validate_certs": false
        }
    },
    "login_result": {
        "IdentityToken": "",
        "Status": "Login Succeeded"
    }
}
META: ran handlers
```

#
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}
DOCUMENTATION = '''
---
module: docker_login
short_description: Log into a Docker registry.
version_added: "2.0"
description:
    - Provides functionality similar to the "docker login" command.
    - Authenticate with a docker registry and add the credentials to your local Docker config file. Adding the
      credentials to the config files allows future connections to the registry using tools such as Ansible's Docker
      modules, the Docker CLI and Docker SDK for Python without needing to provide credentials.
    - Running in check mode will perform the authentication without updating the config file.
options:
  registry_url:
    required: False
    description:
      - The registry URL.
    type: str
    default: "https://index.docker.io/v1/"
    aliases:
      - registry