### Summary

If you use `ansible-galaxy` to install a role to a path specified by both environment variable `ANSIBLE_ROLES_PATH` and `--roles-path=` galaxy will fail to extract the role, and infinitely loop trying to extract the archive.

### Issue Type

Bug Report

### Component Name

galaxy

### Ansible Version

```console
$ ansible --version
ansible 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ncelebic/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ncelebic/py3venv/lib/python3.8/site-packages/ansible
  executable location = /home/ncelebic/py3venv/bin/ansible
  python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
```


### Configuration

```console
$ ansible-config dump --only-changed
```


### OS / Environment

Ubuntu 20.04
Python 3.8 virtualenv 

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```
mkdir roles
chmod -w roles
ANSIBLE_ROLES_PATH=./roles/ ansible-galaxy install geerlingguy.repo-epel --roles-path=./roles
```


### Expected Results

If you use just the env var `ANSIBLE_ROLES_PATH` it errors out with: 
```
/home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel: [Errno 13] Permission denied:
'/home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel'
```

That is the expected outcome

### Actual Results

```console
$ ANSIBLE_ROLES_PATH=./roles/ ansible-galaxy install geerlingguy.repo-epel --roles-p
ath=./roles
- downloading role 'repo-epel', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-repo-epel/archive/3.1.0.tar.gz
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
- extracting geerlingguy.repo-epel to /home/ncelebic/test/galaxy_test/roles/geerlingguy.repo-epel
... forever
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
loose_versions = [LooseVersion(a.get('name', None)) for a in role_versions]
                        try:
                            loose_versions.sort()
                        except TypeError:
                            raise AnsibleError(
                                'Unable to compare role versions (%s) to determine the most recent version due to incompatible version formats. '
                                'Please contact the role author to resolve versioning conflicts, or specify an explicit role version to '
                                'install.' % ', '.join([v.vstring for v in loose_versions])
                            )
                        self.version = to_text(loose_versions[-1])
                    elif role_data.get('github_branch', None):
                        self.version = role_data['github_branch']
                    else:
                        self.version = 'master'
                elif self.version != 'master':
                    if role_versions and to_text(self.version) not in [a.get('name', None) for a in role_versions]:
                        raise AnsibleError("- the specified version (%s) of %s was not found in the list of available versions (%s)." % (self.version,
                                                                                                                                         self.name,
                                                                                                                                         role_versions))
                
                for role_version in role_versions:
                    if role_version['name'] == self.version and 'source' in role_version:
                        self.src = role_version['source']
                    if role_version['name'] == self.version and 'download_url' in role_version:
                        self.download_url = role_version['download_url']
                tmp_file = self.fetch(role_data)
        else:
            raise AnsibleError("No valid role data found")
        if tmp_file:
            display.debug("installing from %s" % tmp_file)