pub fn validate_fd(fd: RawFd) -> Result<()>
Validate that a file descriptor is valid and open.
Uses fcntl(F_GETFL) to check if the fd is valid.