Only check credentials when credentials are supplied

Every request to the OCS API has previously triggered an authentication try. In case no credentials have been supplied (as some clients do) this lead to an authentication error in the logfile such as:

```json
{"app":"core","message":"Login failed: '' (Remote IP: '::1', X-Forwarded-For: '')","level":2,"time":"2014-11-18T21:46:39+00:00"}
```

To test this open a private browser window and access `ocs/v1.php/cloud/users/admin` with and without the patch and compare the log entries.

Potentially fixes https://github.com/owncloud/core/issues/12269 though this might also have another reason.

@karlitschek This is against stable7. Please confirm. The current implementation can lead to problems when used in combination with fail2ban etc...
@MorrisJobke Care to review this? :)