Fix symlink creation issue when link have invalid target.