Mechanical change to eliminate some cruft by using the new take_fdopen{_unlocked}() wrappers where trivial.