Fixed DBPermissionManager.isValidSession() behavior for internal sessions

supergash internal sessions will have neither a persona invid nor a user
invid, and we need to be able to cope with that.
Cleaned up DBPermissionManager.getAvailableOwnerGroups() a bit.