Fix removing objects with stale entries in `object_references`
We don’t clean up the object_references
table when we remove an
object. When successively removing forks, recently added common objects
would not be removed due to these stale entries.
To fix this, we have to replicate the same filtering logic we were doing to account for an outdated swh-graph.