Use threading.local to separate sessions.

The fedbadges backend was designed to only have one thread.

This past week we gave it many threads (so that it could keep up with
its increasingly demanding workload), but this has started to generate
crashes from race conditions (mostly inside sqlalchemy).

This patch will not solve all of those problems, but it will solve some.
This will make it so that *each* thread will get its very own database
session so that they don't stomp on each other quite so much.
PEP8.
PEP8.
Merge pull request #41 from fedora-infra/feature/race-conditions

Use threading.local to separate sessions.