Optimize rdataset_getownercase not to use bitshifts

The last rdataset_getownercase() left it in a state where the code was
mix of microoptimizations (manual loop unrolling, complicated bitshifts)
with a code that would always rewrite the character even if it stayed
the same after transformation.

This commit makes sure that we modify only the characters that actually
need to change, removes the manual loop unrolling, and replaces the
weird bit arithmetics with a simple shift and bit-and.

(cherry picked from commit 5ee9edc4)
77 jobs for !5072 with 2515-improve-glue-cache-performance-v9_16 in 18 minutes and 48 seconds (queued for 8 seconds)
latest detached
Status Job ID Name Coverage
  Precheck
passed #1740207
amd64 linux
autoreconf

00:00:16

passed #1740209
amd64 linux
clang-format

00:00:18

passed #1740210
amd64 linux
coccinelle

00:03:21

passed #1740211
amd64 linux
danger

00:00:15

passed #1740208
amd64 linux
misc

00:00:13

 
  Build
passed #1740224
amd64 linux
clang:asan

00:03:50

passed #1740228
amd64 linux
clang:buster:amd64

00:01:51

passed #1740231
amd64 libvirt
clang:freebsd11:amd64

00:01:54

passed #1740232
amd64 libvirt
clang:freebsd12:amd64

00:01:47

passed #1740233
amd64 libvirt
clang:openbsd:amd64

00:03:25

passed #1740226
amd64 linux
clang:tsan

00:02:10

passed #1740212
amd64 linux
gcc:alpine3.13:amd64

00:01:52

passed #1740223
amd64 linux
gcc:asan

00:03:13

passed #1740216
amd64 linux
gcc:buster:amd64

00:01:13

passed #1740213
amd64 linux
gcc:centos7:amd64

00:01:25

passed #1740214
amd64 linux
gcc:centos8:amd64

00:01:40

passed #1740222
amd64 linux
gcc:focal:amd64

00:01:42

passed #1740227
amd64 linux
gcc:mutexatomics

00:01:26

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

00:01:44

passed #1740217
amd64 linux
gcc:sid:amd64

00:01:59

passed #1740219
i386 linux
gcc:sid:i386

00:01:46

passed #1740229
amd64 linux
gcc:softhsm2.4

00:01:25

passed #1740230
amd64 linux
gcc:softhsm2.6

00:01:51

passed #1740215
amd64 linux
gcc:stretch:amd64

00:01:51

passed #1740225
amd64 linux
gcc:tsan

00:01:54

passed #1740220
amd64 linux
gcc:tumbleweed:amd64

00:01:26

passed #1740221
amd64 linux
gcc:xenial:amd64

00:01:46

passed #1740235
amd64 windows
msvc:windows:amd64

00:00:58

passed #1740234
amd64 linux
nolibtool:sid:amd64

00:02:08

 
  Unit
passed #1740247
amd64 linux
unit:clang:asan

00:01:15

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

00:00:37

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

00:01:03

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

00:01:08

passed #1740249
amd64 linux
unit:clang:tsan

00:01:33

passed #1740236
amd64 linux
unit:gcc:alpine3.13:amd64

00:00:55

passed #1740246
amd64 linux
unit:gcc:asan

00:01:13

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

00:00:58

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

00:00:54

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

00:00:38

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

00:00:39

passed #1740250
amd64 linux
unit:gcc:mutexatomics

00:00:42

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

00:00:36

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

00:00:45

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

00:00:42

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

00:00:38

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

00:00:38

passed #1740248
amd64 linux
unit:gcc:tsan

00:01:52

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

00:00:47

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

00:00:43

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

00:00:50

 
  System
passed #1740268
amd64 linux
system:clang:asan

00:13:57

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

00:12:06

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

00:11:00

failed #1740276
amd64 libvirt
system:clang:freebsd12:amd64

00:11:00

passed #1740270
amd64 linux
system:clang:tsan

00:15:38

passed #1740257
amd64 linux
system:gcc:alpine3.13:amd64

00:12:07

passed #1740267
amd64 linux
system:gcc:asan

00:13:48

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

00:12:51

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

00:12:16

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

00:11:35

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

00:11:56

passed #1740271
amd64 linux
system:gcc:mutexatomics

00:11:59

failed #1740262
amd64 linux
system:gcc:sid:amd64

00:11:48

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

00:10:11

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

00:11:39

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

00:11:29

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

00:11:19

passed #1740269
amd64 linux
system:gcc:tsan

00:15:48

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

00:11:16

failed #1740265
amd64 linux
system:gcc:xenial:amd64

00:11:35

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

00:11:43

 
  Docs
failed #1740278
amd64 linux
docs

00:02:16

 
  Postcheck
passed #1740282
amd64 linux
cppcheck

00:00:22

passed #1740279
amd64 linux
flake8

00:00:20

passed #1740283
amd64 linux
gcov

00:00:32

76.0%
passed #1740280
amd64 linux
pylint

00:00:22

passed #1740281
amd64 linux
scan-build

00:09:53

 
Name Stage Failure
failed
system:gcc:sid:amd64 System
No job log
failed
system:gcc:xenial:amd64 System
No job log
failed
system:clang:freebsd12:amd64 System
No job log
failed
docs Docs
No job log