libmemhack: fix and enhance config buffer handling

ATTENTION: This fix is very important!

We've noticed instability with two memory classes and great enough
max. object count per class. What happened was that the mem_addrs
pointer has been set overlapping with the previous memory class
due to missing sizeof(void *) multiplication.

So add a lot more debugging output and fix the calculations so that
the result is correct and there is no division by zero anymore.
We check now much stricter if everything fits into the config
buffer and don't allow any incomplete config anymore. It's all or
nothing, now.
ugtrain: reduce dynamic memory printing

If we have a lot of objects which get created, kicked out and freed
all the time, then we really have too much output. It is better to
check how many objects have been created/freed/kicked out at once.
It is also important how many objects remain in order to know that
the own interesting objects are still handled.
We've also noticed a bug that console output stopped due to too
much output although the freezing continued.

So reduce the output and only print counts per cycle.