popen.c: some cleanup, use other wait_child() from now on