[test] fix wrong filehandle test

cygwin 5.18 cannot do Cwd::abs_path on a non-existent file. Workaround that.
The underlying problem is that we do not need to UNLINK a not-created file.
Fixes GH #1077 on cygwin.