wrapper functions for pipe(2) and dup2(2) syscalls