When running CMake under Leak or Address Sanitizer tools, the fake reporting
would get picked up by the outer CMake and reported as leaks and address
failures on the CMake dashboard. This commit makes sure the test only
reports simulated errors when asked to.
This adds support for memory and leak sanitizers. This is built into
clang and gcc 4.8 and new compilers. It is activated with a -f switch
during compile.