[ASan tests] Auto-define ASAN_NEEDS_SEGV rather than hardcode it in cmake