[LTO] Introduce an Output class to wrap the output stream creation (NFC)
While NFC for now, this will allow more flexibility on the client side
to hold state necessary to back up the stream.
Also when adding caching, this class will grow in complexity.
Note I blindly modified the gold-plugin as I can't compile it.
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D23542