callcgi: Properly wait for the handler process to exit.