Decrements the reference count and closes the database when no references remain.
Refcount contract: call once per successfulopenDatabase, never per
rejection. A rejected open already cleared its own bookkeeping, so a call
paired with it decrements whatever entry a successor installed under the same
name. createManagedConnection honours this — it only closes while it
holds a promise, and every rejection path drops that promise first.
Decrements the reference count and closes the database when no references remain.
Refcount contract: call once per successful openDatabase, never per rejection. A rejected open already cleared its own bookkeeping, so a call paired with it decrements whatever entry a successor installed under the same name. createManagedConnection honours this — it only closes while it holds a promise, and every rejection path drops that promise first.