Fix race condition with file locking
Fixed error when trying to delete a value that equals the default value