MDL-40897 avoid extra DB queries in groups_get_activity_groupmode()