utils: Fix the item id on retries
When iterating with a thread pool, always try to compute a useful identifier rather than doing son when debug is enabled, since the itemid is also used when reporting about exceptions and retrying.
When iterating with a thread pool, always try to compute a useful identifier rather than doing son when debug is enabled, since the itemid is also used when reporting about exceptions and retrying.