Cause: Trying to download a file which is in fact a directory, using the guestfs_download API / guestfish 'download' command.
Consequence: Downloading a directory using the guestfs_download API or guestfish 'download' command is an error. However libguestfs would get confused and the lose protocol synchronization instead.
Fix: Test if the source of the download is a directory and return an error if so.
Result: Trying to download a directory will print an error instead of getting confused.