[clang-tidy] Count errors in ClangTidyDiagnosticConsumer

This re-applies r222363 reverted in r222390 after compilation errors in our
out-of-tree clang-tidy tests were fixed.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@222427 91177308-0d34-0410-b5e6-96231b3b80d8