introduce for_each_thread() to replace the buggy while_each_thread(
(fix)

fix a merge derp. pointed out by neobuddy89