libsnapshot: Refactor WriteSnapshotAndHash.

This adds a helper around WrapSnapshotAndHash to avoid manually calling
it as most tests have to do. It also changes the signature so a
PartitionUpdate is passed rather than a name, which gives access to
partition information for debugging.

Bug: 208944665
Test: builds
Change-Id: Icd1cdf9d49c48f5a44c35ab1b86f43287e429f86
3 files changed