[lld][MachO] Skip relinking -object_path_lto files that already match the cache (#237099)
On an incremental ThinLTO link the object file from the previous link is
usually already a hardlink to the same cache entry. Compare the two
before touching anything, and take the modification time from the status
that is already at hand instead of stat'ing the result again. The output
path is also saved once up front and passed around as a StringRef
instead of being copied for each use.
On a 47k-module incremental ThinLTO link, saveOrHardlinkBuffer drops
from 5% of link time to 0.3%.
Also stop a link without -cache_path_lto from overwriting cache entries
through hardlinks left in -object_path_lto.