[libc][cmake] Remove dependencies for bare-metal hermetic testing (#192242)
Unit tests can be disabled on bare-metal as they will fail to build. To
prevent the check-libc and check-libc-lit targets from always attempting
to build them, the dependencies are now set conditionally according to
the relevant CMake options.