threadpool: Move iteration logic to it's own method

By moving it to a method you use python's natural scoping rules and
enforce that even in the future iteration local variables don't leak
out.

Change-Id: I0a300682ce9e05a055a3534a935718cc73239acb
Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/22263
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
Tested-by: Yaniv Bronhaim <ybronhei@redhat.com>