ws: First give libssh chance to handle socket errors

We handle them as a last resort, but let libssh at the errors
first so we can hopefully get more intelligent errors based on
its state.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Flush EOF and close packets better during mock-sshd shutdown

Trying to fix various shutdown races here.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>