high level file locking file interface

Not sure if useful enough for batteries, but I found this code nice for coarse-grained concurrent updates on files.