BOLT used ToolOutputFile::keep to make sure the intermediary object
file was written to disk for debugging purposes when --keep-tmp was
passed. However, since and intermediary buffer_ostream was used to
stream to, and this class only writes to its output stream in its
destructor, the object file was lost whenever its destructor wouldn't
run. This could happen, for example, if there is a crash while linking.
This patch makes sure the object file is written to disk immediately
after we're done creating it. This is very useful while debugging
JITLink crashes. This patch also gets rid of creating a temporary file
when --keep-tmp is not passed by streaming the object file directly to
a SmallString.