Part of https://github.com/astral-sh/ruff/issues/13694. Add type narrowing for `issubclass(class, classinfo)` tests.