Reuse temp zip archive for code generation.

Additionally fixes renaming issue on Win, temp file desc is
closed once generation is completed.