[ty] Reject incompatible explicit variance in generic base classes (#25327)
## Summary
Prior to this change, we accepted legacy generic subclasses whose
explicitly declared variance was incompatible with a specialized base
class. For example:
```python
from typing import Generic, TypeVar
T = TypeVar("T")
T_co = TypeVar("T_co", covariant=True)
class Invariant(Generic[T]): ...
class Bad(Invariant[T_co]): ...
```
`Bad` claims covariance even though its invariant base requires its type
parameter to remain invariant.
This brings `aliases_variance.py` and `generics_variance.py` into
conformance.