Backport PR #5668: allow async output on the most recent request

Keeps track of the most recent request, so async output is still allowed

closes #5407
schedule async flush

allows threadsafe flush from background threads