Lock/unlock file