Fix getting group '0' from database backend

Fix #9972
Fix isLoggedIn() check for user '0'

Fix #9972

Conflicts:
	lib/private/user/session.php
remove unused variable
remove trailing slash from path
Merge pull request #10204 from owncloud/backport-10144-stable7

Backport of #10144 to stable7
InstanceId is properly injected into factory. Remove comment.
Memcache\Factory: Remove static, use globalPrefix.
Add registerAutoloaderCache().
prevent PHP errors and enhance logging
fix return documentation
dont strip the s from the resource
use id instead of resourceId
Merge pull request #10226 from owncloud/fix-lowlat-cache-autoload-stable7

Fix lowlat cache autoload stable7
Fix Folder::getById
return null instead of throwing an exception
Fix SharedCache::getPathById
trim leading slash
fix tiny thumbnails in public preview/share mode
we can only close the session if encryption is not used
Use human readable relative date for oc-dialog-filepickers