##### SUMMARY
See #72412.

Fixed by @bcoca's patch https://paste.debian.net/1170589/

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
core

##### ANSIBLE VERSION
```paste below
devel
```

##### STEPS TO REPRODUCE
```yaml
- hosts: remote_server
  tasks:
  - copy:
      src: t.yml
      dest: /tmp/t.yml
    delegate_to: localhost
```
Connect to remote server with `root`.

##### EXPECTED RESULTS
Works.

##### ACTUAL RESULTS
```paste below
fatal: [remote-server]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /root/.ansible/tmp `\"&& mkdir \"` echo /root/.ansible/tmp/ansible-tmp-1604856819.0247443-194052-180695334418942 `\" && echo ansible-tmp-1604856819.0247443-194052-180695334418942=\"` echo /root/.ansible/tmp/ansible-tmp-1604856819.0247443-194052-180695334418942 `\" ), exited with result 1", "unreachable": true}
```

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
    name: local
    short_description: execute on controller
    description:
        - This connection plugin allows ansible to execute tasks on the Ansible 'controller' instead of on a remote host.
    author: ansible (@core)
    version_added: historical
    notes:
        - The remote user is ignored, the user with which the ansible CLI was executed is used instead.
'''
import os
import shutil
import subprocess
import fcntl
import getpass
import ansible.constants as C
from ansible.errors import AnsibleError, AnsibleFileNotFound
from ansible.module_utils.compat import selectors
from ansible.module_utils.six import text_type, binary_type
from ansible.module_utils._text import to_bytes, to_native, to_text
from ansible.plugins.connection import ConnectionBase
from ansible.utils.display import Display
from ansible.utils.path import unfrackpath
display = Display()
class Connection(ConnectionBase):