Fix ssh restart hang