### Summary

When a path in a collection is a symlink to a directory, the symlink is replaced with an empty dir instead of either a copy of the symlink target or the original symlink.

collection source:
```
$ tree -Ap --noreport ~/my_namespace/testcollection/collection/roles/php/templates/etc/php
[drwxr-xr-x]  roles/php/templates/etc/php
├── [drwxr-xr-x]  7.3
│   └── [drwxr-xr-x]  fpm
│       └── [drwxr-xr-x]  pool.d
│           └── [-rw-r--r--]  www.conf.j2
└── [lrwxrwxrwx]  7.4 -> 7.3
```

collection after installation (from git source):
```
$ tree -Ap --noreport ~/.ansible/collections/ansible_collections/my_namespace/testcollection/roles/php/templates/etc/php
[drwxr-xr-x]  roles/php/templates/etc/php
├── [drwxr-xr-x]  7.3
│   └── [drwxr-xr-x]  fpm
│       └── [drwxr-xr-x]  pool.d
│           └── [-rw-r--r--]  www.conf.j2
└── [drwxr-xr-x]  7.4
```

role `meta/requirements.yml` contains the following:
```
collections:
  - name: my_namespace.testcollection
    source: git+file:///home/twouters/my_namespace/testcollection#/collection/
    version: 2022.31.0-coll5
    type: git
```

contents of collection tar.gz after `ansible-galaxy collection build` seems to still be correct:
```
$ tar -tvf my_namespace-testcollection-2022.31.0-coll5.tar.gz | grep -F roles/php/templates
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/
lrw-r--r-- 0/0               0 1970-01-01 01:00 roles/php/templates/etc/php/7.4 -> 7.3
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/7.3/
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/7.3/fpm/
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/7.3/fpm/pool.d/
-rw-r--r-- 0/0             430 2022-08-03 11:31 roles/php/templates/etc/php/7.3/fpm/pool.d/www.conf.j2
```

installation from tar.gz with `ansible-galaxy collection install --force my_namespace-testcollection-2022.31.0-coll5.tar.gz` is fine:
```
$ tree -Ap --noreport ~/.ansible/collections/ansible_collections/my_namespace/testcollection/roles/php/templates/etc/php
[drwxr-xr-x]  roles/php/templates/etc/php
├── [drwxr-xr-x]  7.3
│   └── [drwxr-xr-x]  fpm
│       └── [drwxr-xr-x]  pool.d
│           └── [-rw-r--r--]  www.conf.j2
└── [lrwxrwxrwx]  7.4 -> 7.3
```

### Issue Type

Bug Report

### Component Name

ansible-galaxy

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.2]
  config file = /home/twouters/.ansible.cfg
  configured module search path = ['/home/twouters/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/twouters/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.5 (main, Aug  1 2022, 07:53:20) [GCC 12.1.0]
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
$
```


### OS / Environment

Arch Linux

### Steps to Reproduce

See summary

### Expected Results

See summary. I expect to either have a copy of the symlink target or preferably the original symlink.

### Actual Results

```console
See summary
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
tar_path = to_text(b_tar_path)
        display.display(u'Created collection for %s at %s' % (collection_name, tar_path))
        return tar_path
def _build_collection_dir(b_collection_path, b_collection_output, collection_manifest, file_manifest):
    """Build a collection directory from the manifest data.
    This should follow the same pattern as _build_collection_tar.
    """
    os.makedirs(b_collection_output, mode=0o0755)
    files_manifest_json = to_bytes(json.dumps(file_manifest, indent=True), errors='surrogate_or_strict')
    collection_manifest['file_manifest_file']['chksum_sha256'] = secure_hash_s(files_manifest_json, hash_func=sha256)
    collection_manifest_json = to_bytes(json.dumps(collection_manifest, indent=True), errors='surrogate_or_strict')
    
    for name, b in [(MANIFEST_FILENAME, collection_manifest_json), ('FILES.json', files_manifest_json)]:
        b_path = os.path.join(b_collection_output, to_bytes(name, errors='surrogate_or_strict'))
        with open(b_path, 'wb') as file_obj, BytesIO(b) as b_io:
            shutil.copyfileobj(b_io, file_obj)
        os.chmod(b_path, 0o0644)
    base_directories = []
    for file_info in sorted(file_manifest['files'], key=lambda x: x['name']):
        if file_info['name'] == '.':
            continue
        src_file = os.path.join(b_collection_path, to_bytes(file_info['name'], errors='surrogate_or_strict'))
        dest_file = os.path.join(b_collection_output, to_bytes(file_info['name'], errors='surrogate_or_strict'))
        existing_is_exec = os.stat(src_file).st_mode & stat.S_IXUSR
        mode = 0o0755 if existing_is_exec else 0o0644
        if os.path.isdir(src_file):
            mode = 0o0755
            base_directories.append(src_file)
            os.mkdir(dest_file, mode)
        else: