[libc++] Properly handle errors happening during Lit configuration

Instead of silently swallowing errors that happen during Lit configuration
(for example trying to obtain compiler macros but compiling fails), raise
an exception with some amount of helpful information.

This should avoid the possibility of silently configuring Lit in a bogus
way, and also provides more helpful information when things fail.

Note that this requires a bit more finesse around how we handle some
failing configuration checks that we would previously return None for.

Differential Revision: https://reviews.llvm.org/D114010

GitOrigin-RevId: f18f9ce3665e51e5f09a3d32f9e36fd24e3a79f7
2 files changed