Don't leak exit status to ssh process.

(cherry picked from commit 5d205aa89841406258680d93b8b45251d41d1e08)

Ticket: #5481