Explicitly call context.config.writeConfig() when dismissing the
Location Search Provider or Google Maps API Key dialogs.
This ensures that the selected values are persisted immediately,
resolving issues where settings changes were lost or not applied.
Also wraps API key input dialog in explicit writeConfig logic.