[autotest] Always use tko tables on master from shards.

tko/db.py was changed to always use settings for the global database.
This added configuration overhead for non-shard machines. This adds
the normal, old settings as a failover.

Also, this adds the global database to django.
A django database router is added to determine to which database
should be used for which models. All tko models are always taken or
written from or into the global database while all other objects
remain unchanged.

This is a re-submit of CL:221018 and contains a fix for the import
error on the builders.

BUG=chromium:419435
TEST=Ran suites and manually tried rpcs.
DEPLOY=apache

Change-Id: Id470ae189231384eda8aa3e78aa97f8dde2548e1
Reviewed-on: https://chromium-review.googlesource.com/222286
Reviewed-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
4 files changed