Fixes valgrind support

The test bench are run under valgrind to detect memory problems unless
the -DUSE_VALGRIND=no parameter is provided during cmake execution.