Fixed #22879 -- Wrapped cursor iterator to intercept database errors coming from __next__ method.

...ethod.

This is needed for django-sqlserver driver.

Ticket #22879
Wouldn't it be simple to do — so that you don't have to define a wrapper class which isn't used anywhere else — something like that:
```Python
def __iter__(self):
    with self.db.wrap_database_errors:
        for item in self.cursor:
            yield item
```