Fix put() fails if destination is a directory and not empty

This pull request fixes the bug `put()` fails to create a directory in the destination. The bug caused in below case.

Source:
* /
  * /a
    * /a/b
      * /a/b/c.txt

Destination:
* /
  * /a
    * /a/b

Operation:
```groovy
put `/a`, '/'
```