Add GetClosedGenericType extension method.