Lock just in case someone will call EnsureSettingsAreUpToDate outside the lock.