[Sanitizer] Generalize compile/link flags for sanitizer_common tests on Android and on other platforms.