This speeds up task copying onto the minion tenfold for tasks with a
lot of dirs (e.g. git/ inside). Most importantly it uses mkdir()
internal to sftp instead running it as a shell command, but there are
also other minor optimizations.
This also reduces logging spam, no longer printing a line for each
file copied.
One last minor fix is to use lstat() instead of stat() to correctly
support symlinks.