Oops, failed to cherry-pick.

See 4e2d91745de4aad0c7e29f385a6540da7519de0a.
Client actor closes socket on shutdown
Don't crash when a RPC times out

Fixes #7