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


error_code = error.get('code') or 'Unknown'
                message_line = u"(HTTP Code: %d, Message: %s Code: %s)" % (self.http_code, error_msg, error_code)
                message_lines.append(message_line)
            full_error_msg = "%s %s" % (message, ', '.join(message_lines))
        else:
            
            galaxy_msg = err_info.get('default', http_error.reason)
            full_error_msg = u"%s (HTTP Code: %d, Message: %s)" % (message, self.http_code, galaxy_msg)
        self.message = to_native(full_error_msg)
CollectionMetadata = collections.namedtuple('CollectionMetadata', ['namespace', 'name', 'created_str', 'modified_str'])
class CollectionVersionMetadata:
    def __init__(self, namespace, name, version, download_url, artifact_sha256, dependencies):
        """
        Contains common information about a collection on a Galaxy server to smooth through API differences for
        Collection and define a standard meta info for a collection.
        :param namespace: The namespace name.
        :param name: The collection name.
        :param version: The version that the metadata refers to.
        :param download_url: The URL to download the collection.
        :param artifact_sha256: The SHA256 of the collection artifact for later verification.
        :param dependencies: A dict of dependencies of the collection.
        """
        self.namespace = namespace
        self.name = name
        self.version = version
        self.download_url = download_url
        self.artifact_sha256 = artifact_sha256
        self.dependencies = dependencies
@functools.total_ordering
class GalaxyAPI: