Fix undefined function problem on windows

os.path.samefile is not implemented on Windows.  Try to replace it
with a path comparison there.