[libc++] Simplify transitive includes test and fix a bug

This patch incorporates the "sanitize" step of the transitive includes
test into the CSV generator itself. In doing so, it removes complexity
in the test but also fixes a bug where we would filter out <__mutex>
from the output, leading to an incorrect list of includes for the
<shared_mutex> header.

Differential Revision: https://reviews.llvm.org/D134830

GitOrigin-RevId: c4ca3a2c4b00033c393f694c1d92d28ff55c69cd
7 files changed