With this change a 64-bit RTLD will check LD_64_* first and if those are
not set it will fall back to checking LD_*. Similarly, the 32-bit RTLDs
check LD_32_*, and then fall back to LD_*.
The main motivation here is CheriBSD, where we have an additional rtld for
CHERI binaries that uses LD_CHERI_*. Therefore, if you have existing 64-bit
software package that ships with a script that sets LD_LIBRARY_PATH to find
the local libraries, this would not work since currently LD_* is only used
by the native RTLD (i.e. CHERI pure-capability for us). To handle this case
this change makes RTLD check the ABI-suffixed variables first and if not
set falls back to LD_*. This still allows for different paths for different
ABI, but handles the program with bundled libraries + launcher script case
better.
Obtained from: CheriBSD (https://github.com/CTSRD-CHERI/cheribsd/pull/874)