Without these changes an application can't link both libclang and
clang-shlib ("clang-cpp") at the same time, because otherwise some flags
are registered twice. This was observable in c-index-test with the flag
"-limited-coverage-experimental" from lib/CodeGen/CodeGenModule.cpp.
This also further reduces the installation size of Clang.
Note that D74106 changes the corresponding logic in llvm_add_library to PUBLIC for this case.