I can not currently build the emacs-24 branch (and haven't found a
commit in it that I can on a quick try), see bug#17629.

That's an indication of a reasonably-serious problem with Emacs and your
platform, which is worrisome and should get fixed. I've responded at
Bug#17629.

Using trunk (git 40f5ec0 * alloc.c (Fgarbage_collect): Fix compilation
with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.) now, built with your
patch and this command:
$ ./autogen.sh && ./configure --without-x && make clean && make
When restarting Emacs, I had the bug happen again right away. Sadly
without a running strace.

If the bug is easily reproducible, that's progress. The patch does fix
a bug (even if it's not your bug), so I've pushed it into the trunk.
Can you get an strace -f of when Emacs stops getting SIGCHLD? That's
the crucial part. That is, early on in all the straces I've seen, child
processes die, Emacs gets a SIGCHLD, and then it calls waitpid (wait4)
to reap them. At some point this stops working, and Emacs no longer
gets a SIGCHLD when a child terminates. We need to find out what this
point is, and what's causing it.

I'm surprised by the above trace. The first kill(-4407,SIGKILL)
succeeds, indicating that Emacs still has a subprocess. But Emacs
doesn't get a SIGCHLD, even after it unblocks SIGCHLD. It would be
helpful to see an 'strace -f' to see what's going on in the children here.