Adjust renaming of directories with a dot in name

Directories will not be considered to have an extension, even if a dot is found. This adjusts the logic to pre-select text when an item is to be renamed, and brings it in line with the rest of the code to handle file extensions.

Fixes #8280