guard against races on Truncate and DumpOut
Merge pull request #43 from tedsuo/master

guard against races on Truncate and DumpOut