Remove stale refs to the ssh and sftp clients

When a connection is closed, the stale `__ssh` and `__sftp` refs
must be removed since this will cause multiple calls to `scp` to fail
since the connections are closed and is not reopened resulting in
read only streams.