test: use awaitable apm.flush() in undici tests (#5168)