ws: Fix race when disconnecting from an ssh transport