lib/process: handle EINTR from waitpid