rework ratelimit distributed queries

instead of adding -1 to the counter, use the cachedb_sub function exported by
the cachedb module. This prevents ratelimit counters from adding extremely
large values for some backends (ex: memcached).
Thanks go to Brett Nemeroff for reporting and testing.

(cherry picked from commit c06183325e408f47ba4e0a1e1be274fe23581e25)