build: Audit for use of pipe2
Haiku unfortunately lacks pipe2, so we have to plan for a fallback at
each site that uses it. This also makes a good time to audit all
existing users of pipe, to see if they should be using pipe2. The
tests fork() but don't fail because of fd leaks; and the nbd plugin
doesn't fork() but was merely using pipe2 for convenience over
multiple fcntl calls. However, the server's quit_fd definitely needs
to be marked CLOEXEC (it's easy to use the sh plugin to show that we
are currently leaking it to children), although doing so can occur
without worrying about atomicity since it is called before threads
begin. Finally, it's also worth updating our set_cloexec helper
function to document that we still prefer atomicity where possible.
Signed-off-by: Eric Blake <eblake@redhat.com>