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

00:01:22

passed #242405
amd64 linux docker
build:linux:amd64

00:01:23

passed #242407
amd64 linux docker
build:turris:omnia

00:01:20

passed #242408
amd64 linux docker allowed to fail
srpm

00:00:52

 
  Test
passed #242417
amd64 linux docker
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
amd64 linux docker
installcheck:linux:amd64

00:01:21

passed #242418
amd64 linux docker
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
amd64 linux docker
lint:pedantic

00:01:35

passed #242419
docker
osx:build

00:02:22

passed #242421
amd64 linux docker
pytests:lint

00:00:56

passed #242422
amd64 linux docker
pytests:run

00:02:14

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

00:02:38

passed #242413
amd64 linux docker
test:linux:amd64

00:01:17

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

00:01:30

 
  Extended
passed #242426
amd64 linux docker
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