Revert "Fix for issue 5739. The copy module does not delete directories it will only unlinks symlinks."

This reverts commit b20dc4f57862885632381c2e4264db7094d13e2f.