Reduce the scope of RT work while holding the big lock

This makes the RT.update_available_resource() method do what it
can in the way of prep work before grabbing the lock to update
the database stats.

Change-Id: I1132e2ab99427688529566c1a1fffb33eab07f3f
Related-Bug: #1371677
Merge "Reduce the scope of RT work while holding the big lock"