### Elasticsearch Version

8.12

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

N/A

### Problem Description

I was fixing an error that omitted the elastic product header checks for V8 (https://github.com/elastic/elasticsearch/blob/8be04463e4ae5795fc3fad45f2d01314eaf81035/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java#L366-L369).
However, by doing that [WatcherYamlRestIT » test {p0=watcher/update_settings/10_update_watcher_settings/Test update and get watch settings api}](https://gradle-enterprise.elastic.co/s/h4tfsqnf7aajk/tests/task/:x-pack:plugin:watcher:qa:rest:yamlRestTest/details/org.elasticsearch.smoketest.WatcherYamlRestIT/test%20%7Bp0%3Dwatcher%2Fupdate_settings%2F10_update_watcher_settings%2FTest%20update%20and%20get%20watch%20settings%20api%7D) starts to fail.
The "X-elastic-product" header is really missing from the headers. I suspect this bug is due to these lines:
https://github.com/elastic/elasticsearch/blob/f77c16b78bab5e9f3ee24974aeba408e254e8c94/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportGetWatcherSettingsAction.java#L65-L73

That clear up the context in the response.

### Steps to Reproduce

The bug is present in all versions from 8.8.0 to current; to trigger it is sufficient to call the API and observer the resulting response, and see that the product header is not there.

A way to do that is to remove the `if` here (https://github.com/elastic/elasticsearch/blob/8be04463e4ae5795fc3fad45f2d01314eaf81035/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java#L366-L369) and run linked failing tests, e.g. 
```./gradlew ':x-pack:plugin:watcher:qa:rest:yamlRestTest' --tests "org.elasticsearch.smoketest.WatcherYamlRestIT.test {p0=watcher/update_settings/10_update_watcher_settings/Test update and get watch settings api}" ```

### Logs (if relevant)

_No response_
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportGetWatcherSettingsAction.java
ThreadPool threadPool,
        ActionFilters actionFilters,
        IndexNameExpressionResolver indexNameExpressionResolver
    ) {
        super(
            GetWatcherSettingsAction.NAME,
            transportService,
            clusterService,
            threadPool,
            actionFilters,
            GetWatcherSettingsAction.Request::new,
            indexNameExpressionResolver,
            GetWatcherSettingsAction.Response::new,
            EsExecutors.DIRECT_EXECUTOR_SERVICE
        );
    }
    @Override
    protected void masterOperation(
        Task task,
        GetWatcherSettingsAction.Request request,
        ClusterState state,
        ActionListener<GetWatcherSettingsAction.Response> listener
    ) {
        final ThreadContext threadContext = threadPool.getThreadContext();
        
        try (ThreadContext.StoredContext ignore = threadContext.stashContext()) {
            IndexMetadata metadata = state.metadata().index(WATCHER_INDEX_NAME);
            if (metadata == null) {
                listener.onResponse(new GetWatcherSettingsAction.Response(Settings.EMPTY));
            } else {