Fix race condition that causes diamond to hang at shutdown.
Merge pull request #350 from lambdafu/master

Fix race condition where diamond hangs at shutdown.
Merge branch 'master' of github.com:BrightcoveOS/Diamond into mysqlng