tests-extra: dynamic linking doesn't prevent proper valgrinding
This patch allows proper valgrind check even with dynamic linking of Knot.
However, it doesn't work (at least on linux) with clang, just with gcc.
For static linking, it works for both gcc and clang like before.