Adding workaround for SSH2 module bug with closing PTY streams.