Move BasicAuth check to "isLoggedIn()"

Ensures that Basic Auth works properly for APIs and removes the need for some even uglier lines of code.

Related to https://github.com/owncloud/core/pull/11155#discussion_r17724967 and needs a backport to stable7.

@PVince81 @DeepDiver1975 @karlitschek Testing welcome. Especially the APIs (e.g. `curl -D - http://admin:admin@localhost/core/index.php/apps/files/api/v1/thumbnail/100/100/welcome.txt`) and https://github.com/owncloud/core/issues/11129
This was added with https://github.com/owncloud/core/commit/4ddf5d92f24121f4fdc3af48cca17724f6f4aea6 and is not necessary anymore. Login and logout works also now with invalid basic auth credentials.

Logout is not something that we can control do due to Basic Auth though, if somebody decides to access ownCloud via Basic Auth the credentials are sent by the browser - nothing we can control.