BZ-980775: in STREAM mode, force event queue flush before executing each query
(cherry picked from commit 582ca92d2a858e53522c3eb7367f736d3a3d2a0b)