Fix compilation if valgrind support is completely disabled

https://bugzilla.gnome.org/show_bug.cgi?id=702648