Fix regression for django.db.transaction.managed