[autotest] Lease hosts according to frontend job priorities.

This cl modifies the way we lease hosts by teaching the
RDBServerHostWrapper to handle host leasing. Though this involves
a seperate query for each host it leads to a design we can later
build atomicity into, because we can check the leased bit on a single
host before setting it. This model of leasing also has the following benefits:
    1. It doesn't abuse the response map.
    2. It gives us more clarity into which reqeusts are acquiring
        hosts by setting the leased bit in step with host validation.
    3. It is more tolerant to db errors because exceptions raised while
        leasing one host will not fail the entire batched request.

This cl also adds an rdb_unittest module.

TEST=Unittests, ran suites.
BUG=chromium:353183
DEPLOY=scheduler

Change-Id: I35c04bcb37eee0191a211c133a35824cc78b5d71
Reviewed-on: https://chromium-review.googlesource.com/193182
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
Tested-by: Prashanth B <beeps@chromium.org>
7 files changed