### Elasticsearch Version

7.17

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Not relevant

### Problem Description

Creating a match all index template is bad and we know it.
I needed it for a test and I created a new index template with a `*` `index_pattern`.

I wanted to delete it after few minutes (so that it wouldn't picked up by any new index creation) and I couldn't, unless updating it to match no index.

It seems to deny the deletion because it reports being used by data streams.

### Steps to Reproduce

Create a Index Template matching all:
```
PUT _index_template/matchall
{
  "index_patterns": [
    "*"
  ],
  "priority": 1,
  "template": {
    "mappings": {
      "_meta": {
        "class": "lol"
      }
    }
  }
}
```

Try to delete it:
```
DELETE _index_template/matchall
```

You get:
```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "unable to remove composable templates [matchall] as they are in use by a data streams [.fleet-actions-results, .logs-deprecation.elasticsearch-default, .slm-history-5, ilm-history-5, logs-elastic_agent-default, logs-elastic_agent.endpoint_security-default, logs-elastic_agent.filebeat-default, logs-elastic_agent.metricbeat-default, logs-endpoint.events.file-default, logs-endpoint.events.library-default, logs-endpoint.events.network-default, logs-endpoint.events.process-default, logs-endpoint.events.registry-default, logs-endpoint.events.security-default, logs-generic-default, logs-windows.powershell-default, logs-windows.powershell_operational-default, logs-windows.sysmon_operational-default, metrics-elastic_agent.elastic_agent-default, metrics-elastic_agent.endpoint_security-default, metrics-elastic_agent.filebeat-default, metrics-elastic_agent.metricbeat-default, metrics-endpoint.metadata-default, metrics-endpoint.metrics-default, metrics-endpoint.policy-default, metrics-system.cpu-default, metrics-system.diskio-default, metrics-system.memory-default, metrics-system.network-default, metrics-system.process-default, metrics-system.process_summary-default, metrics-system.socket_summary-default, metrics-system.uptime-default, metrics-windows.perfmon-default, metrics-windows.service-default]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "unable to remove composable templates [matchall] as they are in use by a data streams [.fleet-actions-results, .logs-deprecation.elasticsearch-default, .slm-history-5, ilm-history-5, logs-elastic_agent-default, logs-elastic_agent.endpoint_security-default, logs-elastic_agent.filebeat-default, logs-elastic_agent.metricbeat-default, logs-endpoint.events.file-default, logs-endpoint.events.library-default, logs-endpoint.events.network-default, logs-endpoint.events.process-default, logs-endpoint.events.registry-default, logs-endpoint.events.security-default, logs-generic-default, logs-windows.powershell-default, logs-windows.powershell_operational-default, logs-windows.sysmon_operational-default, metrics-elastic_agent.elastic_agent-default, metrics-elastic_agent.endpoint_security-default, metrics-elastic_agent.filebeat-default, metrics-elastic_agent.metricbeat-default, metrics-endpoint.metadata-default, metrics-endpoint.metrics-default, metrics-endpoint.policy-default, metrics-system.cpu-default, metrics-system.diskio-default, metrics-system.memory-default, metrics-system.network-default, metrics-system.process-default, metrics-system.process_summary-default, metrics-system.socket_summary-default, metrics-system.uptime-default, metrics-windows.perfmon-default, metrics-windows.service-default]"
  },
  "status" : 400
}
```

The list seems to be composed by all the data streams.

## Workaround

Update the `index_patterns` to something non-existing.
```
PUT _index_template/matchall
{
  "index_patterns": [
    "none"
  ],
  "priority": 1,
  "template": {
    "mappings": {
      "_meta": {
        "class": "lol"
      }
    }
  }
}
```

Then delete it:
```
DELETE _index_template/matchall
```

### Logs (if relevant)

_No response_
modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/DataStreamIT.java
indexDocs("metrics-foo", numDocs2); 
        int numDocs3 = randomIntBetween(2, 10);
        indexDocs("metrics-foo", numDocs3); 
        int totalDocs = numDocs1 + numDocs2 + numDocs3;
        SearchSourceBuilder source = new SearchSourceBuilder();
        source.fetchField(new FieldAndFormat(DEFAULT_TIMESTAMP_FIELD, "epoch_millis"));
        source.size(totalDocs);
        SearchRequest searchRequest = new SearchRequest(new String[] { "metrics-foo" }, source);
        SearchResponse searchResponse = client().search(searchRequest).actionGet();
        assertEquals(totalDocs, searchResponse.getHits().getTotalHits().value);
        SearchHit[] hits = searchResponse.getHits().getHits();
        assertEquals(totalDocs, hits.length);
        
        long timestamp1 = Long.valueOf(hits[0].field(DEFAULT_TIMESTAMP_FIELD).getValue()); 
        long timestamp2 = Long.valueOf(hits[0 + numDocs3].field(DEFAULT_TIMESTAMP_FIELD).getValue()); 
        long timestamp3 = Long.valueOf(hits[0 + numDocs3 + numDocs2].field(DEFAULT_TIMESTAMP_FIELD).getValue());  
        assertTrue(timestamp1 > timestamp2);
        assertTrue(timestamp2 > timestamp3);
    }
    public void testCreateDataStreamWithSameNameAsIndexAlias() throws Exception {
        CreateIndexRequest createIndexRequest = new CreateIndexRequest("my-index").alias(new Alias("my-alias"));
        assertAcked(client().admin().indices().create(createIndexRequest).actionGet());
        
        DataStreamIT.putComposableIndexTemplate("my-template", List.of("my-*"));
        var request = new CreateDataStreamAction.Request("my-alias");
        var e = expectThrows(IllegalStateException.class, () -> client().execute(CreateDataStreamAction.INSTANCE, request).actionGet());
        assertThat(e.getMessage(), containsString("[my-alias (alias of ["));
        assertThat(e.getMessage(), containsString("]) conflicts with data stream"));
    }
    public void testCreateDataStreamWithSameNameAsIndex() throws Exception {