Never prefix table names with $wgSharedDB when used in foreign DB

Now database classes have an extra "foreign" property when used in
foreign databases, where $wgSharedDB and $wgSharedTables are not
considered.

Bug: 48819
Change-Id: I45db6860d0a4b4480e0b93aa7e750f096424e40f
Merge "Never prefix table names with $wgSharedDB when used in foreign DB"