Look up header dependencies on the first-output build

Ninja has special syntax to specify the first output of the given node.
E.g. it builds foo.o for foo.cc^. However, it doesn't work for
headers, as headers usually doesn't appear in the regular dependency
tree.

After this change, Ninja looks up header dependencies from .ninja_deps
to pick up a build target, so that it builds foo.o for foo.h^.
4 files changed