Fix MOSH_ESCAPE_KEY validation

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
mosh-client: Catch all exceptions when ensuring client is shut down

Signed-off-by: Anders Kaseorg <andersk@mit.edu>