Guard against older versions of psycopg2 when setting read-only