Resolve symlinks in paths before comparing

Alternative implementation, same intent as 63bb7ef9c63c45405c4d6ca70ba06f69f57118d2