pick (#40613) fix allocate size improper in append_and_flush introduced by https://github.com/apache/doris/pull/38960