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.
32 jobs from log-flushing in 27 minutes and 19 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Build
passed #242406
docker linux amd64
build:asan:linux:amd64

00:01:22

passed #242405
docker linux amd64
build:linux:amd64

00:01:23

passed #242407
docker linux amd64
build:turris:omnia

00:01:20

passed #242408
docker linux amd64 allowed to fail
srpm

00:00:52

 
  Test
passed #242417
docker linux amd64
deckard:linux:amd64

00:01:50

passed #242425
privileged
distro:epel-7

00:02:17

passed #242424
privileged
distro:fedora-29

00:03:00

passed #242416
docker
doc

00:00:56

passed #242414
dind
docker:build

00:02:45

passed #242415
docker linux amd64
installcheck:linux:amd64

00:01:21

passed #242418
docker linux amd64
installcheck:valgrind:linux:amd64

00:02:40

passed #242411
docker
lint:c

00:02:54

passed #242412
docker
lint:clang-scan-build

00:01:14

passed #242410
docker
lint:lua

00:00:27

passed #242409
docker linux amd64
lint:pedantic

00:01:35

passed #242419
docker
osx:build

00:02:22

passed #242421
docker linux amd64
pytests:lint

00:00:56

passed #242422
docker linux amd64
pytests:run

00:02:14

passed #242423
docker linux amd64
respdiff:iter:udp:linux:amd64

00:02:38

passed #242413
docker linux amd64
test:linux:amd64

00:01:17

passed #242420
docker linux amd64
test:linux:amd64:valgrind

00:01:30

 
  Extended
passed #242426
docker linux amd64
pytests:extended

00:03:10

failed #242427
respdiff
respdiff:fwd-tls6-kresd.udp6

00:11:52

passed #242428
respdiff
respdiff:fwd-udp6-kresd.udp6

00:15:54

passed #242432
respdiff
respdiff:fwd-udp6-unbound.tcp6

00:22:24

failed #242433
respdiff
respdiff:fwd-udp6-unbound.tls6

00:08:22

passed #242431
respdiff
respdiff:fwd-udp6-unbound.udp6

00:22:54

failed #242430
respdiff
respdiff:iter.tls6

00:09:23

failed #242429
respdiff
respdiff:iter.udp6

00:13:23

passed #242434
respdiff
resperf:fwd-tls6.udp-asan

00:13:19

passed #242435
respdiff
resperf:fwd-udp6.udp-asan

00:17:19

passed #242436
respdiff
resperf:iter.udp-asan

00:15:49

 
Name Stage Failure
failed
respdiff:fwd-udp6-unbound.tls6 Extended
Running after script...
$ cp -t . respdiff_commitdir/$RESPDIFF_TEST/j* ||:
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=33294 revision=4745a6f3 version=11.8.0
./j*: found 11 matching files
./*.png: found 3 matching files
Uploading artifacts to coordinator... ok id=242433 responseStatus=201 Created token=oRzvmNkh
ERROR: Job failed: exit status 1
failed
respdiff:iter.udp6 Extended
Running after script...
$ cp -t . respdiff_commitdir/$RESPDIFF_TEST/j* ||:
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=33666 revision=4745a6f3 version=11.8.0
./j*: found 11 matching files
./*.png: found 3 matching files
Uploading artifacts to coordinator... ok id=242429 responseStatus=201 Created token=mrhNh2Sm
ERROR: Job failed: exit status 1
failed
respdiff:iter.tls6 Extended
Running after script...
$ cp -t . respdiff_commitdir/$RESPDIFF_TEST/j* ||:
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=33377 revision=4745a6f3 version=11.8.0
./j*: found 11 matching files
./*.png: found 3 matching files
Uploading artifacts to coordinator... ok id=242430 responseStatus=201 Created token=xroNDKzz
ERROR: Job failed: exit status 1
failed
respdiff:fwd-tls6-kresd.udp6 Extended
Running after script...
$ cp -t . respdiff_commitdir/$RESPDIFF_TEST/j* ||:
$ cp -t . respdiff_commitdir/*$RESPDIFF_TEST*.png ||:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=33525 revision=4745a6f3 version=11.8.0
./j*: found 11 matching files
./*.png: found 3 matching files
Uploading artifacts to coordinator... ok id=242427 responseStatus=201 Created token=TeXaikVd
ERROR: Job failed: exit status 1