Options.mode to set mode on copied directories

Currently the mode option only sets mode on files. Directories are left with default rights regardless of the parameter. It is an issue when copying folder hierarchies with varying rights.

I changed the code so that `options.mode` also impacts destination directories, with same rules (`true` means copy source rights, `0644` means set to specified rights)