Use correct error message when renaming/deleting folder

This is for #8003.
This is still lowercase "Invalid filename" and "Invalid directory name".  It doesn't look like DIRECTORY_NAME / FILENAME strings  are used elsewhere so you should be able to modify them but double check that I didn't miss anything.