properly close sftp session