Fix getting group '0' from database backend

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

Fix #9972

Conflicts:
	lib/private/user/session.php
Merge pull request #10204 from owncloud/backport-10144-stable7

Backport of #10144 to stable7