This patch rewrites llvm-lto's codegen() using ThinCodeGenerator::run().
The change is NFC-ish (if you pass multiple files, the all files will now be codegen'd first and then written to disk instead of writing each module to disk after it has been codegen'd.
This is supposed to make https://reviews.llvm.org/D33151 simpler.