Correctly exit SSH task.