### Summary

When trying to install a collection from a local directory, it fails if the directory has a trailing slash (/). If the trailing slash is removed, the installation succeeds.

### Issue Type

Bug Report

### Component Name

ansible-galaxy

### Ansible Version

```console
$ ansible --version
ansible [core 2.14.0.dev0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /home/redacted/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/redacted/.virtualenvs/dev-ansible/bin/ansible
  python version = 3.10.4 (main, Apr  8 2022, 17:35:13) [GCC 9.4.0] (/home/redacted/.virtualenvs/dev-ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed
CONFIG_FILE() = /etc/ansible/ansible.cfg
```


### OS / Environment

Ubuntu 20.04
Python 3.10.4

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
ansible-galaxy collection install -vvvvvv -f -p ~/devcollections ansible-collection-dir/
```


### Expected Results

I expected the collection to be installed.

### Actual Results


The relevant part of the output is "b'ansible-collection-dir/lugins/README.md'". As can be seen, the "plugins" directory name is being truncated by one character.

```console
ansible-galaxy [core 2.14.0.dev0]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /home/redacted/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/redacted/.virtualenvs/dev-ansible/bin/ansible-galaxy
  python version = 3.10.4 (main, Apr  8 2022, 17:35:13) [GCC 9.4.0] (/home/redacted/.virtualenvs/dev-ansible/bin/python3)
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
Starting galaxy collection install process
[WARNING]: The specified collections path '/home/redacted/devcollections' is not part of the configured Ansible collections paths '/home/redacted/.ansible/collections:/usr/share/ansible/collections'. The installed collection will not be picked up in an Ansible run, unless
within a playbook-adjacent collections directory.
Process install dependency map
Starting collection install process
Installing 'mynamespace.mycollection:1.0.0' to '/home/redacted/devcollections/ansible_collections/mynamespace.mycollection'
Skipping 'ansible-collection-dir/.git' for collection build
Skipping 'ansible-collection-dir/galaxy.yml' for collection build
ERROR! Unexpected Exception, this is probably a bug: [Errno 2] No such file or directory: b'ansible-collection-dir/lugins/README.md'
the full traceback was:

Traceback (most recent call last):
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/__init__.py", line 623, in cli_executor
    exit_code = cli.run()
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 646, in run
    return context.CLIARGS['func']()
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 102, in method_wrapper
    return wrapped_method(*args, **kwargs)
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 1300, in execute_install
    self._execute_install_collection(
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/cli/galaxy.py", line 1328, in _execute_install_collection
    install_collections(
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 719, in install_collections
    install(concrete_coll_pin, output_path, artifacts_manager)
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1276, in install
    install_src(collection, b_artifact_path, b_collection_path, artifacts_manager)
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1410, in install_src
    collection_output_path = _build_collection_dir(
  File "/home/redacted/.virtualenvs/dev-ansible/lib/python3.10/site-packages/ansible/galaxy/collection/__init__.py", line 1205, in _build_collection_dir
    existing_is_exec = os.stat(src_file).st_mode & stat.S_IXUSR
FileNotFoundError: [Errno 2] No such file or directory: b'ansible-collection-dir/lugins/README.md'
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
return self.fqcn.split('.')
    @property
    def namespace(self):
        if self.is_virtual:
            raise TypeError('s do not have a namespace')
        return self._get_separate_ns_n_name()[0]
    @property
    def name(self):
        if self.is_virtual:
            raise TypeError('s do not have a name')
        return self._get_separate_ns_n_name()[-1]
    @property
    def canonical_package_id(self):
        if not self.is_virtual:
            return to_native(self.fqcn)
        return (
            '<virtual namespace from {src!s} of type {src_type!s}>'.
            format(src=to_native(self.src), src_type=to_native(self.type))
        )
    @property
    def is_virtual(self):
        return self.is_scm or self.is_subdirs
    @property
    def is_file(self):
        return self.type == 'file'
    @property
    def is_dir(self):