[1.6.x] Fixed #13116 -- Described scope of variables created by {% url ... as var %} syntax.

Thanks leif_p for the suggestion.

Backport of 4a5aac47a6 from master