Fix symlink issues because of cross-device link errors.

The issue happens when the destination is in a network share.