Use correct error message when renaming/deleting folder

This is for #8003.
Ahh, I missed those. Fixed.