[1.5.x] Fixed #19940 -- Made test.runner.setup_databases properly handle aliases for defau

Thanks simonpercivall.

Backport of 2cbd579efe from master.