Fix race condition on check_stale_header

This commit fix a race that could happen when two or more threads have
failed to refresh the same RRset, the threads could simultaneously
attempt to update the header->last_refresh_fail_ts field in
check_stale_header, a field used to implement stale-refresh-time.

By making this field atomic we avoid such race.
79 jobs for !4609 with 2442-tsan-error-lib-dns-rbtdb-c in 42 minutes and 29 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Autoconf
passed #1442980
amd64 linux
autoreconf

00:00:18

 
  Precheck
passed #1442982
amd64 linux
clang-format

00:00:17

passed #1442983
amd64 linux
coccinelle

00:03:38

passed #1442984
amd64 linux
danger

00:00:15

passed #1442981
amd64 linux
misc

00:00:18

passed #1442985
amd64 linux
tarball-create

00:01:35

 
  Build
passed #1442998
amd64 linux
clang:asan

00:02:10

passed #1443002
amd64 linux
clang:buster:amd64

00:00:54

passed #1443005
amd64 libvirt
clang:freebsd11:amd64

00:01:20

passed #1443006
amd64 libvirt
clang:freebsd12:amd64

00:01:08

passed #1443007
amd64 libvirt
clang:openbsd:amd64

00:02:33

passed #1443000
amd64 linux
clang:tsan

00:01:27

passed #1442986
amd64 linux
gcc:alpine3.12:amd64

00:01:05

passed #1442997
amd64 linux
gcc:asan

00:01:40

passed #1442990
amd64 linux
gcc:buster:amd64

00:00:48

passed #1442987
amd64 linux
gcc:centos7:amd64

00:00:53

passed #1442988
amd64 linux
gcc:centos8:amd64

00:00:55

passed #1442996
amd64 linux
gcc:focal:amd64

00:01:08

passed #1443001
amd64 linux
gcc:mutexatomics

00:01:06

passed #1442992
amd64 linux
gcc:out-of-tree

00:01:07

passed #1442991
amd64 linux
gcc:sid:amd64

00:01:10

passed #1442993
i386 linux
gcc:sid:i386

00:01:00

passed #1443003
amd64 linux
gcc:softhsm2.4

00:00:59

passed #1443004
amd64 linux
gcc:softhsm2.6

00:00:57

passed #1442989
amd64 linux
gcc:stretch:amd64

00:01:10

passed #1442999
amd64 linux
gcc:tsan

00:01:11

passed #1442994
amd64 linux
gcc:tumbleweed:amd64

00:01:05

passed #1442995
amd64 linux
gcc:xenial:amd64

00:01:09

passed #1443008
amd64 windows
msvc:windows:amd64

00:00:52

 
  Unit
passed #1443020
amd64 linux
unit:clang:asan

00:01:25

passed #1443024
amd64 linux
unit:clang:buster:amd64

00:01:17

passed #1443027
amd64 libvirt
unit:clang:freebsd11:amd64

00:01:28

passed #1443028
amd64 libvirt
unit:clang:freebsd12:amd64

00:01:31

passed #1443029
amd64 libvirt
unit:clang:openbsd:amd64

00:02:43

passed #1443022
amd64 linux
unit:clang:tsan

00:02:47

passed #1443009
amd64 linux
unit:gcc:alpine3.12:amd64

00:01:12

passed #1443019
amd64 linux
unit:gcc:asan

00:01:18

passed #1443013
amd64 linux
unit:gcc:buster:amd64

00:02:06

passed #1443010
amd64 linux
unit:gcc:centos7:amd64

00:01:07

passed #1443011
amd64 linux
unit:gcc:centos8:amd64

00:01:10

passed #1443018
amd64 linux
unit:gcc:focal:amd64

00:01:11

passed #1443023
amd64 linux
unit:gcc:mutexatomics

00:01:08

passed #1443014
amd64 linux
unit:gcc:sid:amd64

00:01:12

passed #1443015
i386 linux
unit:gcc:sid:i386

00:01:04

passed #1443025
amd64 linux
unit:gcc:softhsm2.4

00:01:06

passed #1443026
amd64 linux
unit:gcc:softhsm2.6

00:01:09

passed #1443012
amd64 linux
unit:gcc:stretch:amd64

00:01:09

passed #1443021
amd64 linux
unit:gcc:tsan

00:04:04

passed #1443016
amd64 linux
unit:gcc:tumbleweed:amd64

00:01:05

passed #1443017
amd64 linux
unit:gcc:xenial:amd64

00:01:10

 
  System
passed #1443041
amd64 linux
system:clang:asan

00:13:43

passed #1443045
amd64 linux
system:clang:buster:amd64

00:11:41

passed #1443155
amd64 libvirt
system:clang:freebsd11:amd64

00:11:57

passed #1443049
amd64 libvirt
system:clang:freebsd12:amd64

00:12:05

passed #1443043
amd64 linux
system:clang:tsan

00:15:23

passed #1443030
amd64 linux
system:gcc:alpine3.12:amd64

00:13:05

passed #1443040
amd64 linux
system:gcc:asan

00:13:54

passed #1443034
amd64 linux
system:gcc:buster:amd64

00:13:23

passed #1443031
amd64 linux
system:gcc:centos7:amd64

00:12:35

passed #1443151
linux amd64
system:gcc:centos8:amd64

00:12:21

passed #1443039
amd64 linux
system:gcc:focal:amd64

00:12:22

passed #1443044
amd64 linux
system:gcc:mutexatomics

00:11:32

passed #1443035
amd64 linux
system:gcc:sid:amd64

00:11:50

passed #1443036
i386 linux
system:gcc:sid:i386

00:13:01

passed #1443046
amd64 linux
system:gcc:softhsm2.4

00:11:48

passed #1443047
amd64 linux
system:gcc:softhsm2.6

00:12:38

passed #1443033
amd64 linux
system:gcc:stretch:amd64

00:12:40

passed #1443042
amd64 linux
system:gcc:tsan

00:15:36

passed #1443037
amd64 linux
system:gcc:tumbleweed:amd64

00:12:34

passed #1443038
amd64 linux
system:gcc:xenial:amd64

00:11:23

failed #1443150
libvirt amd64
system:clang:freebsd11:amd64

00:11:59

failed #1443048
amd64 libvirt
system:clang:freebsd11:amd64

00:12:04

failed #1443032
amd64 linux
system:gcc:centos8:amd64

00:13:03

 
  Docs
passed #1443050
amd64 linux
docs

00:00:53

 
  Postcheck
passed #1443054
amd64 linux
cppcheck

00:00:40

passed #1443051
amd64 linux
flake8

00:00:27

passed #1443055
amd64 linux
gcov

00:00:32

77.0%
passed #1443052
amd64 linux
pylint

00:00:24

passed #1443053
amd64 linux
scan-build

00:04:14