Merge "Fix stream flushing when SYNC_FLUSH is set."