Subninja chdir: 'phony' default rule

This fixes the following error in a subninja chdir:

ninja: error: b/build.ninja:8: unknown build rule 'phony'
build all: phony b2.txt
           ^ near here

The bug is caused by the builtin rules (just one rule in this case)
being added to the root scope in the State() constructor. Since
subninja chdir's have a weird scope for their root scope -- one that
both points to its parent and also acts like it has no parent --
the scope gets the builtin rules added just like a root scope.

The subninja chdir scope points to its parent to be able to translate
relative paths to absolute paths.

The subninja chdir scope blocks traversal to its parent when looking
up variables and rules.

This commit fixes the one problem with blocking traversal to its parent:
the default rules (just one rule, the rule for "phony") are not visible
in a chdir.

Change-Id: I42b6011a3ed87924f5c8738c7d049d7d2b311e4f
4 files changed