[BZ-973661][BZ-973677] fix check for use of stream mode when necesary + sliding windows related tests
(cherry picked from commit c780e6d82c144bf047522b29e700ab30c2bf4389)