Simple locking mechanism on top of flock()