dns: fix dns configure code

Yaml layout changed. DNS had to be updated to retrievel value
for dns flood from the correct location in the config tree.
dns: add memcap options

Add per state and global memcap option parsing.
dns: make DNSTransactionAlloc static
dns: add memcap checking

Add memuse tracking and memcap checking to the DNS parsers. Memuse
is tracked globally and per flow (state).

Memcaps are also checked per flow and globally before memory allocs
are done.
Pass ThreadVars ptr to various thread init funcs

To be able to register counters from AppLayerGetCtxThread, the
ThreadVars pointer needs to be available in it and thus in it's
callers:

- AppLayerGetCtxThread
- DecodeThreadVarsAlloc
- StreamTcpReassembleInitThreadCtx
app-layer: update UDP entry function

Update AppLayerHandleUdp to take the ThreadVars pointer as an
argument in prepraration of handling counters in this function.
dns: register counters

Register dns memory counters.
Keep track of memcap reached conditions, and increment counters for
those.
dns: update counters

This patch updates the DNS counters from the main AppLayer entry
functions. Due to the limited scope of AppLayerThreadCtx some of
the logic had to be implemented in app-layer.c, where it doesn't
belong.
dns: add event for when memcap is reached

Raise event if state-memcap is reached for a flow.