config: allow locking the configuration

This lock allows a reader to lock the configuration from updating when
it is reading a complex configuration.