<!--- 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

Modules using NETCONF (at least the JunOS and Huawei ones) are broken in Ansible v2.9.7. They fail with the following error message:

> Unable to decode JSON from response to get_capabilities(). Received 'None'.

Ansible v2.9.6 works fine. According to `git-bisect`, the bug was introduced in commit a41f09901bfb2bc5bcd222818c637436dc01a861 by @Qalthos:

```
a41f09901bfb2bc5bcd222818c637436dc01a861 is the first bad commit
commit a41f09901bfb2bc5bcd222818c637436dc01a861
Author: Nathaniel Case <ncase@redhat.com>
Date:   Tue Apr 14 21:18:23 2020 -0400

    [stable-2.9] Fix missing persistent connection messages (#68496) (#68562)
    
    * [stable-2.9] Fix missing persistent connection messages (#68496)
    
    * Be more proactive about returning module messages
    
    * Move message display to a function, and replace handling already in shutdown().
    (cherry picked from commit 5f6427b1fc7449a5c42212013d3f628665701c3d)
    
    Co-authored-by: Nathaniel Case <ncase@redhat.com>
    
    * Add changelog

 changelogs/fragments/68496-persistent-logging.yaml  |  3 +++
 .../cli/scripts/ansible_connection_cli_stub.py      | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 changelogs/fragments/68496-persistent-logging.yaml
```

I have not tested the `devel` branch, as it fails with a  *«the connection plugin 'netconf' was not found»* error message. I presume this is unrelated.

##### ISSUE TYPE
- Bug Report

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

* ce_config
* junos_facts
* junos_config

(there are probably others)

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```console
[:~/git/ansible/ansible] [venv] a41f09901b* ± ansible --version
ansible 2.9.6.post0
  config file = /home/tore/git/ansible/ansible/ansible.cfg
  configured module search path = ['/home/tore/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/tore/git/ansible/ansible/lib/ansible
  executable location = /home/tore/git/ansible/ansible/bin/ansible
  python version = 3.7.6 (default, Jan 30 2020, 09:44:41) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```console
[:~/git/ansible/ansible] [venv] a41f09901b* ± ansible-config dump --only-changed
DEFAULT_HOST_LIST(/home/tore/git/ansible/ansible/ansible.cfg) = ['/home/tore/git/ansible/ansible/hosts']
HOST_KEY_CHECKING(/home/tore/git/ansible/ansible/ansible.cfg) = False
```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->

Host running Ansible in the test case below is running Fedora 31. I have also reproduced in an Alpine container with Ansible installed using `pip`.

The target device used in test case below is a Juniper EX4200-48T running JunOS 12.3R12-S10, but it seems to impact all JunOS devices in my production environment.

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between quotes below -->
```console
[:~/git/ansible/ansible] [venv] a41f09901b* ± cat ansible.cfg 
[defaults]
host_key_checking = false
inventory = ./hosts
[:~/git/ansible/ansible] [venv] a41f09901b* ± cat hosts 
[all]
switch ansible_connection=netconf ansible_network_os=junos
[:~/git/ansible/ansible] [venv] a41f09901b* ± ansible -m junos_facts all
[WARNING]: Platform linux on host switch is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
switch | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "msg": "Unable to decode JSON from response to get_capabilities(). Received 'None'."
}
```

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

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->

```console
[:~/git/ansible/ansible] [venv] a41f09901b* ± git checkout a41f09901b^
Previous HEAD position was a41f09901b [stable-2.9] Fix missing persistent connection messages (#68496) (#68562)
HEAD is now at ea4f6e1539 nxos_lacp: updated tests to handle platforms not supporting lacp system mac command (#64074)
[:~/git/ansible/ansible] [venv] ea4f6e1539* ± ansible -m junos_facts all
[WARNING]: default value for `gather_subset` will be changed to `min` from `!config` v2.11 onwards
[WARNING]: Platform linux on host switch is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
switch | SUCCESS => {
[…]
```

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes -->
```console
[:~/git/ansible/ansible] [venv] a41f09901b* ± ansible -vvvv -m junos_facts all
ansible 2.9.6.post0
  config file = /home/tore/git/ansible/ansible/ansible.cfg
  configured module search path = ['/home/tore/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/tore/git/ansible/ansible/lib/ansible
  executable location = /home/tore/git/ansible/ansible/bin/ansible
  python version = 3.7.6 (default, Jan 30 2020, 09:44:41) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
Using /home/tore/git/ansible/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/tore/git/ansible/ansible/hosts as it did not pass its verify_file() method
script declined parsing /home/tore/git/ansible/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /home/tore/git/ansible/ansible/hosts as it did not pass its verify_file() method
Parsed /home/tore/git/ansible/ansible/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /home/tore/git/ansible/ansible/lib/ansible/plugins/callback/minimal.py
META: ran handlers
<switch> attempting to start connection
<switch> using connection plugin netconf
<switch> local domain socket does not exist, starting it
<switch> control socket path is /home/tore/.ansible/pc/de1ee28bd4
<switch> local domain socket listeners started successfully
<switch> loaded netconf plugin junos from path /home/tore/git/ansible/ansible/lib/ansible/plugins/netconf/junos.py for network_os junos
<switch>
<switch> local domain socket path is /home/tore/.ansible/pc/de1ee28bd4
<switch> ESTABLISH LOCAL CONNECTION FOR USER: tore
<switch> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h `"&& mkdir /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206 && echo ansible-tmp-1587376485.1662843-256918-170184907858206="` echo /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206 `" ) && sleep 0'
<switch> Attempting python interpreter discovery
<switch> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<switch> Python interpreter discovery fallback (pipelining support required for extended interpreter discovery)
Using module file /home/tore/git/ansible/ansible/lib/ansible/modules/network/junos/junos_facts.py
<switch> PUT /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/tmpronsk3k0 TO /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206/AnsiballZ_junos_facts.py
<switch> EXEC /bin/sh -c 'chmod u+x /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206/ /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206/AnsiballZ_junos_facts.py && sleep 0'
<switch> EXEC /bin/sh -c '/usr/bin/python /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206/AnsiballZ_junos_facts.py && sleep 0'
<switch> EXEC /bin/sh -c 'rm -f -r /home/tore/.ansible/tmp/ansible-local-256914roxp0s8h/ansible-tmp-1587376485.1662843-256918-170184907858206/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
  File "/tmp/ansible_junos_facts_payload_hd535j_j/ansible_junos_facts_payload.zip/ansible/module_utils/network/common/network.py", line 229, in get_capabilities
    capabilities = Connection(module._socket_path).get_capabilities()
  File "/tmp/ansible_junos_facts_payload_hd535j_j/ansible_junos_facts_payload.zip/ansible/module_utils/connection.py", line 179, in __rpc__
    response = self._exec_jsonrpc(name, *args, **kwargs)
  File "/tmp/ansible_junos_facts_payload_hd535j_j/ansible_junos_facts_payload.zip/ansible/module_utils/connection.py", line 161, in _exec_jsonrpc
    "Unable to decode JSON from response to {0}({1}). Received '{2}'.".format(name, params, out)
[WARNING]: Platform linux on host switch is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
switch | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "invocation": {
        "module_args": {
            "config_format": "text",
            "gather_network_resources": null,
            "gather_subset": [
                "!config"
            ],
            "host": null,
            "password": null,
            "port": null,
            "provider": null,
            "ssh_keyfile": null,
            "timeout": null,
            "transport": null,
            "username": null
        }
    },
    "msg": "Unable to decode JSON from response to get_capabilities(). Received 'None'."
}
```


msg = 'command timeout triggered, timeout value is %s secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide.'\
              % self.connection.get_option('persistent_command_timeout')
        display.display(msg, log_only=True)
        raise Exception(msg)
    def handler(self, signum, frame):
        msg = 'signal handler called with signal %s.' % signum
        display.display(msg, log_only=True)
        raise Exception(msg)
    def shutdown(self):
        """ Shuts down the local domain socket
        """
        lock_path = unfrackpath("%s/.ansible_pc_lock_%s" % os.path.split(self.socket_path))
        if os.path.exists(self.socket_path):
            try:
                if self.sock:
                    self.sock.close()
                if self.connection:
                    self.connection.close()
                    display_messages(self.connection)
            except Exception:
                pass
            finally:
                if os.path.exists(self.socket_path):
                    os.remove(self.socket_path)
                    setattr(self.connection, '_socket_path', None)
                    setattr(self.connection, '_connected', False)
        if os.path.exists(lock_path):
            os.remove(lock_path)
        display.display('shutdown complete', log_only=True)
def main():