pipe: use pipe2 feature test; check fcntl retval

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>