Add context manager for configuration flags.