storage: Stop accessing the db attribute directly
Summary:
This puts the indexer storage in line with swh.storage when D324 is
applied.
Test Plan: unsurprisingly, make test still works
Differential Revision: https://forge.softwareheritage.org/D328