Fix `isdir` checking inside of SFTP class

We have to use `stat` instead of `lstat` inside `isdir` method, since
the first one returns `True` even for symlinks to folders.

The fix is very important when we need to download some folder that
contains a symlink to another one.
Typo fix
Changelog, closes #1147
break the loop when the host is gateway itself
Formatting tweaks
Changelog, fixes #1165
Merge branch '1.7' into 1.8
Merge branch '1.8' into 1.9
Merge branch '1.9'