sftpfs: refactoring: move handling of socket errors to separate function.