[Sanitizer/ASan tests] Automatically detect the presence of libstdc++