Forbid queries in broken transactions

https://code.djangoproject.com/ticket/21134

​https://groups.google.com/d/topic/django-developers/ACLQRF-71s8/discussion