close fd only when open success