Redmine#4719 validating user name both forr classic and TLS protocol.

If there are some characters in the user name we assume is invalid
connection with the client is terminated.
Merge pull request #1569 from pasinskim/escaping_username

Redmine#4719 validating user name both forr classic and TLS protocol.