Reapply "[ORC] Add unit tests for parts of the ..." with fixes and improvements.
This reapplies 87403600, which was reverted in bbddadd4 due to buildbot
errors.
This version checks that a JIT instance can be safely constructed, skipping
tests if it can not be. To enable this it introduces new C API to retrieve and
set the target triple for a JITTargetMachineBuilder.