GROOVY-6889: clean up generated code when using @AutoExternalize with @C...

...ompileStatic