Fix fdopen(3) and wait(2) in pkg_repo_create.
Migrate from pipes to sockets.