Resolve issues with corner-cases introduced by [0].
- Comparing the filename & filepath was no longer a valid way to check
for a directory component since the extension was stripped.
- Use BLI_path_extension_or_end which doesn't confuse extensions with
the dot from hidden files.
The variable name include_directory was also misleading.
[0]: 1a648f5b22