win, fs: detect if symlink target is a directory
On Windows creating a symlink to a directory will not work unless extra 'dir'
parameter is passed. This adds a check if link target is a directory, and if so automatically use 'dir'
when creating the symlink.
Ref: https://github.com/nodejs/node/pull/23691
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines