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 form folders before
Besides fix some comparisons to strict comparisons
on the go.