Move authentication failed logging to checkPassword

Fixes https://github.com/owncloud/core/issues/10366
Fix unit test