Add valgrind support to the make files

-> make memtest will now valgrind all autotests rather than just running
   them
-> Valgrind is configured to return an exit code of 1 if it finds an
   error, failing the build

The environment variable VALGRIND_OPTIONS can be used to overide the
arguments to valgrind