Fixed double close in ssh inputstream