io.c: sync with upstream r1.25

"Mon Aug 11 20:28:47 2014 UTC
Still need to separately set FD_CLOEXEC if the new fd was >= FDBASE.
Affects scripts that directly use 9 of the first 10 fds.

noted by miod@"

/guenther@/