session: return error in ssh_termination_functions

Update each helper 'ssh_termination_function' callback to return -1
for distinguishing error cases.
session: update ssh_termination_function contract

Update the contract for 'ssh_termination_function' callbacks to
allow for expressing poll termination due to error conditions.
session: fix ssh_handle_packets_termination errors

Teach 'ssh_handle_packets_termination' to return SSH_ERROR for
the case that termination predicates return -1.
channel: remove redundant state checks
messages: remove redundant state check