killpg(): close a race with fork(), part 2
(cherry picked from commit 232b922cb363e01ac0dd2a277d93cf74d8485e79)