Change g_log (and friends) to print to stderr. Fixes #10577.

Stdout is block buffered somewhere (and fflushing 'stdout' doesn't
fix it, only fflushing all streams works), and takes forever to
show up in any output.