Correct for Variant + ARRAY cases in psycopg2
Fixed regression caused by :ticket:`6023` where the PostgreSQL cast
operator applied to elements within an :class:`_types.ARRAY` when using
psycopg2 would fail to use the correct type in the case that the datatype
were also embedded within an instance of the :class:`_types.Variant`
adapter.
Additionally, repairs support for the correct CREATE TYPE to be emitted
when using a ``Variant(ARRAY(some_schema_type))``.
Fixes: #6182
Change-Id: I1b9ba7c876980d4650715a0b0801b46bdc72860d
(cherry picked from commit
43e98c75bde96ef27daeaf7fbfbea30b7eb7c295)