fix race condition in utils.lock
Merge pull request #390 from ndawe/lockfile

[MRG] fix race condition in utils.lock