pipe fd creation improvements.

switch to pipe2, and pass in variations of possible flags.