For subshell die support (bug 465008), we need to re-check cgroup.procs until it's empty, in case any of the listed process fork before we've had a chance to kill them.
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_566420 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/44fe5595b94cf4a78fc37c50b97cc610
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=007236f06506744fdb67910af5d7fb69783dbfe1
Fixed in 2.2.26.