Use Django 1.6 transaction API

This will break compatibility with older Django releases.