Detect and avoid directory-hardlink infinite loops.