mosh-client: Print exceptions after the client is shut down

Otherwise the printed exception may be immediately hidden when the terminal exits alternate screen mode.