[BUGFIX] Fix warning during extension installation

During unpacking of an extension in the installation
process it can happen that the extension data
contains folders in the file list.

These folders need to be removed from the list
in order to avoid warnings when trying to write
directories as files.

Also remove duplicates from folders before
creating them.

Besides fix some (non related) comparisons to
strict comparisons on the go.

Resolves: #57261
Releases: 6.2
Change-Id: Ib6821a0a438ebc9441b8fa2ee3fbd7869f23ec7f
Reviewed-on: https://review.typo3.org/28731
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny