[libc++] Conditionally declare `lgamma_r` as noexcept (#156547)
An older PR https://github.com/llvm/llvm-project/pull/102036 suggested
that LLVM libc declares `lgamma_r` as noexcept and is incompatible with
this redeclaration. However, I recently discovered that glibc also
declares the math functions to be noexcept under C++ mode.
This line usually don't cause issues because both the glibc and this
file are included as "system headers". According to [this
godbolt](https://godbolt.org/z/o7Wd9PP58), both GCC and clang ignore the
different exception specification between multiple declarations if they
are in system headers.
However, this seems not the case for NVCC/EDG, so a fix for this
redeclaration is still desirable. This patch proposes that we should
declare the function as noexcept under known libc integrations to keep
the declared function consistent.