genpipe.c: remove kernel_sock code and fixed minor bugs