macOS: Speed up rpath install name dir lookup with a cache

Fixes: #20602
2 files changed