utils: Move config locking out of Settings