fix detection of non-local path, fixes #3108
filenames like ..foobar are valid, so, to detect stuff in upper dirs,
we need to include the path separator and check if it starts with '../'.
(cherry picked from commit 60e924910034b86d3d9c6e9af706e5559cdb4d19)