database: update dbutil-based constructors
Created by: unknwon
Updates a few dbutil-based constructors to accept datbase.DB
instead, as they are not mockable in our tests.
Subscribed team please let me know if some dbutil.DB
s are on purpose and can break if not using it.
This is the result of a time-boxed effort.
Test plan
Unit tests
Part of https://github.com/sourcegraph/sourcegraph/issues/26113