Optimize check_gn_headers.py for speed

Process the output of 'ninja' live through the pipe rather than waiting
for it to finish.

Before:
20.74user 16.36system 0:24.57elapsed 151%CPU

After:
16.63user 9.24system 0:13.94elapsed 185%CPU

BUG=661774

Review-Url: https://codereview.chromium.org/2842513003
Cr-Commit-Position: refs/heads/master@{#466900}
2 files changed