Make LoadBalancer domain handling more robust
* Cleanup setDomainPrefix() methods to handle existing LBs/DBs.
* This also makes it set just the prefix as the prefix rather
than as the whole domain.
* Fix regression from
789a54a5f1 where "read" mode of
tablePrefix()/dbSchema() still set the field.
* Make getConnectionRef() always have the domain set.
* Add a check in openConnection() for explicit local
connections, treating $domain as false and avoiding
openForeignConnection().
Bug: T145840
Change-Id: Idf392bd9992a215c4fa3bddf275562f3916596aa