Merge pull request #591 from nico/fixrestat

Fix restat builds with edges generating headers depended on through deps...
Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is needed.

No functionality change. Related to issue #590.