HPCC-12085 Avoid malloc/free when updating the buffer callbacks

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #6345 from ghalliday/issue12085

HPCC-12085 Avoid malloc/free when updating the buffer callbacks

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>