Using thread both as the iteration variable and the source of the list
causes list_for_each_entry to derail after the first thread that has no
hit. This could be triggered by sending a process a signal that was in
sigwait, but not for that signal.
Fix this by using a stable list pointer.
Signed-off-by: Jan Kiszka <firstname.lastname@example.org>