implement basic infrastructure for scoped cache

This commit adds support for scoped cache, e.g. keys can be tagged
with a scope, so that the same key can exist in multiple scope and
returns the value based on the scope set.

This is practically requires for scoping by subnet in ECS, but
it doesn't implement ECS completely. This is just a framework
to make something like ECS possible in a module.

The scope search is currently non-exhaustive, it either returns
a value bound to given scope or look into global scope, nothing
in between.
18 jobs for marek/support-scoped-cache in 8 minutes and 47 seconds (queued for 6 seconds)
latest
Status Job ID Name Coverage
  Build
passed #133742
docker linux amd64
build:clang:linux:amd64

00:00:37

passed #133741
docker linux amd64
build:linux:amd64

00:00:36

passed #133743
docker linux amd64 allowed to fail
srpm

00:00:24

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

00:07:10

passed #133757
privileged
distro:epel-7

00:02:59

passed #133756
privileged
distro:fedora-27

00:04:05

passed #133749
docker
doc

00:00:45

passed #133748
docker linux amd64
installcheck:linux:amd64

00:00:59

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

00:01:33

passed #133745
docker
lint:c

00:02:14

failed #133746
docker allowed to fail
lint:clang-scan-build

00:01:03

passed #133744
docker
lint:lua

00:00:38

passed #133754
docker linux amd64
respdiff:iter:tcp:linux:amd64

00:03:14

passed #133755
docker linux amd64
respdiff:iter:tls:linux:amd64

00:03:14

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

00:03:14

passed #133747
docker linux amd64
test:linux:amd64

00:01:13

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

00:01:14

 
  Coverage
passed #133758
docker linux amd64
coverage

00:00:57

69.0%
 
Name Stage Failure
failed
lint:clang-scan-build Test
  CCLD	modules/cookies/cookies.so
CCLD modules/stats/stats.so
CCLD modules/hints/hints.so
scan-build: 28 bugs found.
scan-build: Run 'scan-view /builds/knot/knot-resolver/scan-results/2018-04-27-070034-14-1' to examine bug reports.
Uploading artifacts...
scan-results: found 33 matching files
Uploading artifacts to coordinator... ok id=133746 responseStatus=201 Created token=J5ERQudh
ERROR: Job failed: exit code 1