Add support for pipe2(2) and chflagsat(2) system calls.

This change adds support for newly added pipe2(2) and chflagsat(2)
system calls.  It also fixes what obviously looks like a bug with the
pipe(2) call emulation.  The pipe descriptors were not written back.