Iterates over an ndb filtered query. Runs iterations in a deferred task.