Repair patch state blob reuse
The patch state blobs found in refs/stacks/<branch>:patches/<patchname>
can/should be reused when saving new stack state. The intent was there,
but when testing whether a patch's state blob was in the previous
TreeData, i.e. with `pn in prev_tree.data`, the test would always fail
because TreeData.__iter__() iterated over (name, (perm, obj)) tuples and
not just patch names.
The issue is resolved by adding a TreeData.__contains__() method.
Signed-off-by: Peter Grayson <pete@jpgrayson.net>