Fix skipped database spec from Sec CI implementation
In the process of implementing Sec DB enabled CI for the decomposition, it was necessary to skip 2 database related tests due to their implementation relying on assumptions related to their only being Main and CI DB's in GitLab at the time of their introduction. Adding the Sec DB causes these to fail due to these assumptions, so we need to reimplement them in a way that they can function correctly regardless of the DB's present.
The skipped specs are in:
spec/workers/loose_foreign_keys/cleanup_worker_spec.rbspec/lib/gitlab/database/tables_locker_spec.rb
Edited by Gregory Havenga