src/main.c: Flush and close STDOUT before calling gl_update().