cmDefinitions: only pull variables if they aren't local

Prior to the commit which changed behavior here, PARENT_SCOPE triggered
a ->GetInternal() call which would internally pull down the parent's
value into the local scope. When converted over to an explicit ->Pull()
call, the logic in ->GetInternal() which ignored the parent if it is
already in scope was missed and instead unconditionally pulled down.

Reported-By: Ben Cooksley <bcooksley@kde.org>
Revert "cmDefinitions: Don't store parent lookups"

This reverts commit 5abfde6cb8a1ae0b2825797eab6c2e9842eb7c49.

The behaviors associated with implicit pulldown on variable lookup
seriously conflict with the optimizations made in these commits.
Basically, since values were copied upon variable lookup, not just on
PARENT_SCOPE, coupled with PARENT_SCOPE's behavior based on whether the
variable is in the current scope or not causes serious problems with not
storing a value for every variable at every scope.

Reported-By: Ben Cooksley <bcooksley@kde.org>
test: add test for PARENT_SCOPE behavior

Test code courtesy of Alex Merry <alex.merry@kde.org>.
test: add a test for PARENT_SCOPE with multiple scopes

See the comment in the test for what is being tested here.
Merge branch 'parent-scope-tests' into variable-pull-failure

* parent-scope-tests:
  test: add a test for PARENT_SCOPE with multiple scopes
  test: add test for PARENT_SCOPE behavior

Conflicts:
	Tests/RunCMake/set/RunCMakeTest.cmake
Merge topic 'revert-definition-map-lookup' into next

4d6715e4 Merge branch 'parent-scope-tests' into variable-pull-failure
e0c0b1ac test: add a test for PARENT_SCOPE with multiple scopes
064c415d test: add test for PARENT_SCOPE behavior
679cb986 Revert "cmDefinitions: Don't store parent lookups"
61032bea cmDefinitions: only pull variables if they aren't local