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

…(fix)

fix a merge derp. pointed out by neobuddy89

Signed-off-by: Paul Reioux <reioux@gmail.com>