file: prevent replace failure when overwriting empty directory with hard/link (force=yes)
Merge pull request #8329 from rdolejsi/devel

file: prevent replace failure when overwriting empty directory with hard or soft link on force=yes