thread: use Valgrind macros to register new stacks on co-routines
thread: use Valgrind macros to register new stacks on co-routines

When debugging with Valgrind, it will alert about stack size changes when
a co-routine is created and a context switch is made, this usually happens
when Fluent Bit perform an 'output -> write' operation with the output plugin.

To avoid this problem, this patch makes the flb_thread interface to use the
Valgrind macros to register the new stack. This feature is only enabled if
Fluent Bit have been configured with the -DWITH_VALGRIND=On CMake option.

Signed-off-by: Eduardo Silva <81f705dc2ce1a61a2621e0e4b442a9474e1d0c70@treasure-data.com>

fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,LogInsight/fluent-bit,takahasi/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,takahasi/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,takahasi/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,LogInsight/fluent-bit,nokute78/fluent-bit,pandax381/fluent-bit,LogInsight/fluent-bit,pandax381/fluent-bit,nokute78/fluent-bit,takahasi/fluent-bit,LogInsight/fluent-bit,pandax381/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,LogInsight/fluent-bit,takahasi/fluent-bit,takahasi/fluent-bit,LogInsight/fluent-bit,nokute78/fluent-bit,LogInsight/fluent-bit,fluent/fluent-bit,pandax381/fluent-bit,fluent/fluent-bit,pandax381/fluent-bit,LogInsight/fluent-bit,pandax381/fluent-bit,pandax381/fluent-bit,takahasi/fluent-bit,fluent/fluent-bit,pandax381/fluent-bit,takahasi/fluent-bit