Make release_add support adding the same object twice in the same call
This is an edge case, but the mirror infrastructure is apparently hitting it.
We modify the SQL query to be properly idempotent.
Also ensure in_memory and cassandra backends behave the same.
Note: this revision was mostly written by
Nicolas Dandrimont <nicolas@dandrimont.eu>.