tersestatus: avoid modifying tersedict
Turn dirnode's methods into generators which can be used to update "tersedict"
in caller. So instead of passing the "tersedict" to be mutated here and there,
it's now clearer where it is updated as it's purely a local variable to
While I was here, I renamed _processtersestatus to tersewalk and
_addfilestotersed to iterfilepaths.
Differential Revision: https://phab.mercurial-scm.org/D1043