Re-apply "Fix lint warning in ClangTidyDiagnosticConsumer.cpp (NFC)" with fixes for the failing ASan tests. This reverts commit 74add1b6.