performance: Writer.build should copy less.

The build method copies the input lists several times. That
cost about 0.1s in the gyp generation for the Chromium project for
no gain.