genpipe.c: fixed queue management bug