text.pretty: create an event string instead of using fprintf()/fputs()
Because the component calls library functions which can log between its
calls to fprintf() or fputs(), the output when logging is enabled is the
output of the component interlaced with library logging statements.
Instead of printing directly to the file stream, append to a component
GString and fwrite() this content at the end.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>