I think this check is insufficient. Consider this pattern:

1. I create a Task with a remote host. I run it and it finishes. `remote_client` is now a closed client instance.
2. I modify the Task to run on my local machine instead. `remote_client` is still there.
3. I try to call `terminate` on the local Task and now it triggers the remote path.