tracbuildbot/buildbot_cache.py: improved db use.