Keying the object-identity dedup map on id(artifact) alone could orphan a
mapping if the same instance were ever stored under two scopes (the second
store overwrote the first's entry, and per-handle cleanup then skipped it).
Key on (id(artifact), scope) so each scope keeps its own handle and cleanup is
exact and unconditional. Also clear _handle_by_obj in the test fixture so stale
id->handle mappings don't accumulate across the session.