Exit when end of file is reached
Refactor SSH channel close logic
Use GLib's memory manager in libssh2