Remove unused imports for UnionTypes codegen. Fixes #2440.