Check the complete include path for being a system include, not the derived framework search path. The code for Ninja and Makefile generators does exactly the same. Fixes: #23011