This can be solved in-fossil with
<verbatim>
setvbuf(stdout, (char *) NULL, _IONBF, 0);
</verbatim>

Out of fossil, GNU coreutils comes with <kbd>stdbuf</kbd>, a script with a LD_PRELOAD that will have that effect.