##### 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}
```

''' transfer a file from local to local '''
        super(Connection, self).put_file(in_path, out_path)
        in_path = unfrackpath(in_path, basedir=self.cwd)
        out_path = unfrackpath(out_path, basedir=self.cwd)
        display.vvv(u"PUT {0} TO {1}".format(in_path, out_path), host=self._play_context.remote_addr)
        if not os.path.exists(to_bytes(in_path, errors='surrogate_or_strict')):
            raise AnsibleFileNotFound("file or module does not exist: {0}".format(to_native(in_path)))
        try:
            shutil.copyfile(to_bytes(in_path, errors='surrogate_or_strict'), to_bytes(out_path, errors='surrogate_or_strict'))
        except shutil.Error:
            raise AnsibleError("failed to copy: {0} and {1} are the same".format(to_native(in_path), to_native(out_path)))
        except IOError as e:
            raise AnsibleError("failed to transfer file to {0}: {1}".format(to_native(out_path), to_native(e)))
    def fetch_file(self, in_path, out_path):
        ''' fetch a file from local to local -- for compatibility '''
        super(Connection, self).fetch_file(in_path, out_path)
        display.vvv(u"FETCH {0} TO {1}".format(in_path, out_path), host=self._play_context.remote_addr)
        self.put_file(in_path, out_path)
    def close(self):
        ''' terminate the connection; nothing to do here '''
        self._connected = False