file locking for read/write of layers.json