Fix race conditions.
Merge pull request #33 from go-pg/fix/fix-race-conditions

Fix race conditions.