[Legacy ThinLTO] Use code model from IR when creating TargetMachine
It is observed that libLTO.so, which uses the legacy ThinLTO interface
respects neither the `--code-model=` option nor the code model encoded
in the IR.
This PR is a fix to respect the code model encoded in the IR.