Refactor analytics receivers to reduce query count

The old behaviour was to issue a get_or_create call, and then increase
a counter field and save the new instance. That will have caused 2 (or
even 3 on older Django versions) queries. The new behaviour now is to
use update() and only issue a create if no instances were affected.

Fixes #806