dup2() closes newfd anyway