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.

(cherry picked from commit c75575e3)
78 jobs for !4630 with 2442-tsan-error-lib-dns-rbtdb-c-v9_16 in 19 minutes and 34 seconds (queued for 7 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1444025
linux amd64
autoreconf

00:00:16

passed #1444027
linux amd64
clang-format

00:00:19

passed #1444028
linux amd64
coccinelle

00:03:32

passed #1444029
linux amd64
danger

00:00:14

passed #1444026
linux amd64
misc

00:00:13

 
  Build
passed #1444042
linux amd64
clang:asan

00:03:46

passed #1444046
linux amd64
clang:buster:amd64

00:01:58

passed #1444049
amd64 libvirt
clang:freebsd11:amd64

00:01:50

passed #1444050
amd64 libvirt
clang:freebsd12:amd64

00:01:59

passed #1444051
amd64 libvirt
clang:openbsd:amd64

00:04:11

passed #1444044
linux amd64
clang:tsan

00:02:15

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

00:01:38

passed #1444041
linux amd64
gcc:asan

00:03:29

passed #1444034
linux amd64
gcc:buster:amd64

00:01:27

passed #1444031
linux amd64
gcc:centos7:amd64

00:01:32

passed #1444032
linux amd64
gcc:centos8:amd64

00:01:33

passed #1444040
linux amd64
gcc:focal:amd64

00:01:39

passed #1444045
linux amd64
gcc:mutexatomics

00:01:36

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

00:01:35

passed #1444035
linux amd64
gcc:sid:amd64

00:02:04

passed #1444037
linux i386
gcc:sid:i386

00:01:47

passed #1444047
linux amd64
gcc:softhsm2.4

00:01:44

passed #1444048
linux amd64
gcc:softhsm2.6

00:01:38

passed #1444033
linux amd64
gcc:stretch:amd64

00:01:52

passed #1444043
linux amd64
gcc:tsan

00:02:01

passed #1444038
linux amd64
gcc:tumbleweed:amd64

00:01:41

passed #1444039
linux amd64
gcc:xenial:amd64

00:01:47

passed #1444053
amd64 windows
msvc:windows:amd64

00:00:57

passed #1444052
linux amd64
nolibtool:sid:amd64

00:01:58

 
  Unit
passed #1444065
linux amd64
unit:clang:asan

00:00:54

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

00:00:36

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

00:01:04

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

00:01:02

passed #1444067
linux amd64
unit:clang:tsan

00:01:33

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

00:00:40

passed #1444064
linux amd64
unit:gcc:asan

00:00:56

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

00:00:57

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

00:00:38

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

00:00:38

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

00:00:35

passed #1444068
linux amd64
unit:gcc:mutexatomics

00:00:35

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

00:00:36

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

00:00:46

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

00:00:33

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

00:00:36

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

00:00:33

passed #1444066
linux amd64
unit:gcc:tsan

00:01:53

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

00:00:40

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

00:00:36

passed #1444074
linux amd64
unit:nolibtool:sid:amd64

00:00:51

 
  System
passed #1444086
linux amd64
system:clang:asan

00:12:47

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

00:12:01

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

00:10:35

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

00:10:26

passed #1444088
linux amd64
system:clang:tsan

00:14:45

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

00:12:23

passed #1444085
linux amd64
system:gcc:asan

00:13:06

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

00:12:49

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

00:11:31

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

00:12:00

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

00:11:52

passed #1444089
linux amd64
system:gcc:mutexatomics

00:11:32

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

00:11:24

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

00:09:47

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

00:11:49

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

00:12:11

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

00:11:31

passed #1444087
linux amd64
system:gcc:tsan

00:14:44

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

00:11:56

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

00:11:21

passed #1444095
linux amd64
system:nolibtool:sid:amd64

00:11:50

 
  Docs
passed #1444256
linux amd64
docs

00:02:12

failed #1444096
linux amd64
docs

00:02:02

 
  Postcheck
passed #1444100
linux amd64
cppcheck

00:00:25

passed #1444097
linux amd64
flake8

00:00:18

passed #1444101
linux amd64
gcov

00:00:34

75.0%
passed #1444098
linux amd64
pylint

00:00:23

passed #1444099
linux amd64
scan-build

00:09:35