fix race condition in utils.lock
Merge pull request #389 from ndawe/master

[MRG] don't allow user to specify negative number of bins
Merge pull request #390 from ndawe/lockfile

[MRG] fix race condition in utils.lock