### Summary

`ansible-galaxy collection install` makes a lot of requests to galaxy.ansible.com and can occasionally hit the rate limit. When that happens, galaxy.ansible.com will return a 520 http code and `ansible-galaxy` fails to download the collection and exits. Ideally when the client encounters a rate limiting http code (either 520, or 429), it should wait, slow down the request rate and try again rather than exiting.

More information is available here: https://github.com/ansible/galaxy/issues/2429 

### Issue Type

Bug Report

### Component Name

ansible-galaxy

### Ansible Version

```console
$ ansible --version
root@ubuntu-s-1vcpu-1gb-nyc3-01:~# ansible --version
ansible 2.10.7
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
```


### Configuration

```console
$ ansible-config dump --only-changed
root@ubuntu-s-1vcpu-1gb-nyc3-01:~# ansible-config dump --only-changed
root@ubuntu-s-1vcpu-1gb-nyc3-01:~#
```


### OS / Environment

All

### Steps to Reproduce

Run `ansible-galaxy collection install `amazon.aws`. If your internet is fast enough, this will occasionally fail when galaxy.ansible.com returns a 520 error code.

### Expected Results

Collection should be installed.

### Actual Results

```console
`ansible-galaxy` encounters a 429 or 520 http code and exits.
```


### Code of Conduct

I agree to follow the Ansible Code of Conduct


monkeypatch.setattr(Display, 'error', mock_err)
    expected = to_native(u'Galaxy import process failed: Becäuse I said so! (Code: GW001)')
    with pytest.raises(AnsibleError, match=re.escape(expected)):
        api.wait_import_task(import_uri)
    assert mock_open.call_count == 1
    assert mock_open.mock_calls[0][1 full_import_uri
    assert mock_open.mock_calls[0][2]['headers']['Authorization'] == '%s my token' % token_type
    assert mock_display.call_count == 1
    assert mock_display.mock_calls[0][1 'Waiting until Galaxy import task %s has completed' % full_import_uri
    assert mock_vvv.call_count == 1
    assert mock_vvv.mock_calls[0][1 u'Galaxy import message: info - Somé info'
    assert mock_warn.call_count == 1
    assert mock_warn.mock_calls[0][1 u'Galaxy import warning message: Some wärning'
    assert mock_err.call_count == 1
    assert mock_err.mock_calls[0][1 u'Galaxy import error message: Somé error'
@pytest.mark.parametrize('server_url, api_version, token_type, token_ins, import_uri, full_import_uri', [
    ('https://ga.com/api/', 'v2', 'Token', GalaxyToken('my_token'),
     '1234',
     'https://ga.com/api/v2/collection-imports/1234/'),
    ('https://ga.com/api/automation-hub/', 'v3', 'Bearer', KeycloakToken(auth_url='https://api.test/'),
     '1234',
     'https://ga.com/api/automation-hub/v3/imports/collections/1234/'),
])
def test_wait_import_task_with_failure_no_error(server_url, api_version, token_type, token_ins, import_uri, full_import_uri, monkeypatch):
    api = get_test_galaxy_api(server_url, api_version, token_ins=token_ins)
    if token_ins:
        mock_token_get = MagicMock()
        mock_token_get.return_value = 'my token'
        monkeypatch.setattr(token_ins, 'get', mock_token_get)
    mock_open = MagicMock()