Use PathFileExists instead of stat on Windows