sgw: properly close the egress file