XWIKI-9474: HTML code in the console when logging-in from a subwiki.

* Refactored a bit the XWikiAuthServiceImpl#authenticate method.
* The "invalidcredentials" message was wrongly sent.
Merge pull request #169 from gdelhumeau/XWIKI-9474

XWIKI-9474: HTML code in the console when logging-in from a subwiki.