Adjust renaming of directories, fixes #8280

Directories will not be considered to have an extension, even if a dot is
found.

Stop Scrutinizer being annoyed

But the spaced version looked good!

Stop jsHint being annoyed

These code quality tools are really pestering
Merge pull request #8284 from owncloud/fix_8280

Adjust renaming of directories with a dot in name