[PATCH openEuler-26.09 362/408] file: add take_fd() cleanup helper