A simple lock implementation using flock.