treewide: fix flushing of messages to logs in some cases
... by setting FILE* properties and replace the explicit flushes. Explicit flushing couldn't be well done e.g. for lua's error() function. In particular, we had problems with journald not getting logs timely.
Showing with 9 additions and 6 deletions