[1.6.x] Fixed #19940 -- Made test.runner.setup_databases properly handle aliases for default db.

Thanks simonpercivall.

Backport of 2cbd579efe from master.