fix(race condition)

https://github.com/jbenet/go-ipfs/issues/270