[1.7.x] Fixed #21166 -- Reset errors_occurred flag after commit and rollback.

Backport of 3033a71 from master.

Conflicts:
	django/db/backends/__init__.py