Refactored OrderedStreams::_flush function to flush available contents ASAP