adding atomic support for use with postgress in Django>=1.6

This fixes some error handling with Postgres databases and Django's atomic support in 1.6.

Without the use of atomic, a generic TransactionManagementError exception is thrown, which is not caught by the existing error handling logic. Adding the use of atomic ensures the correct exception types will be thrown, and subsequently caught.