uloop: Fix race condition in SIGCHLD handling