### 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
#
#
#
#
#
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import errno
import datetime
import os
import tarfile
import tempfile
from ansible.module_utils.compat.version import LooseVersion
from shutil import rmtree
from ansible import context
from ansible.errors import AnsibleError
from ansible.galaxy.user_agent import user_agent
from ansible.module_utils._text import to_native, to_text
from ansible.module_utils.common.yaml import yaml_dump, yaml_load
from ansible.module_utils.urls import open_url
from ansible.playbook.role.requirement import RoleRequirement
from ansible.utils.display import Display
display = Display()
class GalaxyRole(object):