Fixed #20681 -- Prevented teardown_databases from attempting to tear down aliases

Thanks simonpercivall.