Fix issue where symlinks got broken

Using `os.path.realpath` when checking `st_ino` was causing symlinks to incorrectly be treated as hard links.