Replace flock by mkdir for file locking, this should be more portable. The
downside is that this could be errornous on certain network file system ?