Fix LinkTask error which occurred when a link was created inside an unexisting directory