Catch when a users codename contains invalid characters

fixes #548. Catch the error produced when a user specifies a codename containing potentially dangerous characters, and flash that user an informative message.
It's best to make this flashed message the same as the other one so we don't leak any information. I can't see how that would be used in an attack here, but better safe then sorry.