Changed file locking mechanism to use mkdir() instead of flock() since s...

...ome implementations of NFS don't support flock.

http://docstore.mik.ua/orelly/webprog/pcook/ch18_25.htm
https://groups.google.com/d/msg/xataface/jPwJVWIqzRs/Ton_LLXJFWIJ