The first attempt occasionally fails, probably due to a race with the
listener's startup.
Additionally, perform minor adjustments to the output written to stderr
to ensure it is properly flushed in the CI environment.
Since we restart Logstash to enable the UDP input prior to running this
test, we should also ensure it has successfully come back, otherwise we
start searching for the expected documents in Elasticsearch way too
early and often run into timeouts.