Do not abort when buffers visit files in nonexistent directories

After `(find-file "/does-not-exist/file")` and switching to an existing file, `magit-status` used to abort when Magit tried to determine whether the file in a nonexistent directory belongs to the current project. This change fixes that.