_setup_pipes: copy descriptor flags after dup2