Fixed #23326 - DatabaseCache.incr is atomic

I'm not sure that this would really make the `incr` operation `atomic`, at least not on Postgres with default serialization level (see http://www.postgresql.org/docs/9.1/static/transaction-iso.html).

That might work using `select_for_update`but I think If I really wanted to do an atomic cache with a database, I would wrap cache access into something like advisory locks (see https://github.com/Xof/django-pglocks).