PostgreSQL locking context managers and functions for Django.