gpui: Fix double-close of fd in read_fd on linux (#48850)
Albab Hasan
created
`read_fd` calls `File::from_raw_fd(fd.as_raw_fd())`, which creates a new
`File` that assumes ownership of the raw fd, while the original
`FileDescriptor` also retains ownership. when both drop at the end of
the function, the same fd is closed twice. between the two closes
another thread can receive that fd number from the kernel for an
unrelated file/socket, and the second close silently kills it. this can
cause hard to diagnose data corruption or i/o failures.
fix: use `fd.into_raw_fd()` instead of `fd.as_raw_fd()` to transfer
ownership to the `File` without running `FileDescriptor`'s drop.
Release Notes:
- N/A