### Description

This applies to the following APIs:
- [x] open anomaly detection
- [x] start datafeed
- [x] start data frame analytics job
- [x] start trained model deployment

Currently, if the operation takes longer than the configured `timeout`, the response status code is `500`.

With Kibana in mind, a `4xx` response would be more suitable as it will lead to showing more useful information to the user about why the request failed.

Looking at [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-408-request-timeout), it seems the most appropriate `4xx` code would be `408 Request Timeout`, even though the RFC describes a different situation. 

The alternative, `504 Gateway Timeout`, would be more appropriate for this situation but it wouldn't improve the user experience in Kibana.
x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsIT.java
);
        putDatafeed(datafeedConfig);
        startDatafeed(datafeedConfig.getId(), 0L, now);
        assertBusy(() -> {
            DataCounts dataCounts = getDataCounts(job.getId());
            assertThat(dataCounts.getProcessedRecordCount(), equalTo(numDocs));
            assertThat(dataCounts.getOutOfOrderTimeStampCount(), equalTo(0L));
            GetDatafeedsStatsAction.Request request = new GetDatafeedsStatsAction.Request(datafeedConfig.getId());
            GetDatafeedsStatsAction.Response response = client().execute(GetDatafeedsStatsAction.INSTANCE, request).actionGet();
            assertThat(response.getResponse().results().get(0).getDatafeedState(), equalTo(DatafeedState.STOPPED));
        }, 60, TimeUnit.SECONDS);
        waitUntilJobIsClosed(job.getId());
    }
    public void testLookbackOnlyRuntimeMapping() throws Exception {
        client().admin().indices().prepareCreate("data-1").setMapping("time", "type=date").get();
        long numDocs = randomIntBetween(32, 2048);
        long now = System.currentTimeMillis();
        long oneWeekAgo = now - 604800000;
        long twoWeeksAgo = oneWeekAgo - 604800000;
        indexDocs(logger, "data-1", numDocs, twoWeeksAgo, oneWeekAgo);
        DataDescription.Builder dataDescription = new DataDescription.Builder();
        Detector.Builder d = new Detector.Builder("count", null);
        
        
        d.setByFieldName("day_of_week");
        AnalysisConfig.Builder analysisConfig = new AnalysisConfig.Builder(Collections.singletonList(d.build()));
        analysisConfig.setBucketSpan(TimeValue.timeValueHours(1));
        Job.Builder jobBuilder = new Job.Builder();
        jobBuilder.setId("lookback-job-with-rt-fields");
        jobBuilder.setAnalysisConfig(analysisConfig);