Fix memory leak in error paths in YAMLTraits by using unique_ptr

There's some other cleanup that could happen here, but this is at least
the mechanical transformation to unique_ptr.

Derived from a patch by Anton Yartsev.
Create a emitCXXStructor function and make the existing emitCXXConstructor and
emitCXXDestructor static helpers.

A next patch will make it a helper in CGCXXABI.
Add a triple to fix the bots.
llvm/test/CodeGen/X86/peephole-fold-movsd.ll: Relax an expression for win32.