Dup an fd for a RW pipe