[FIXED JENKINS-16846] fix logic and add test

FilePath#moveAllChildrenTo faild,
when same name directory exist.