Remove illegal characters from config filename