Switch GsiService to Splitfiemap.

This patch switches GsiService entirely from FiemapWriter to
SplitFiemap. This had a few side effects:

First, the ImageMap that gets passed around is now a class member. This
simplifies a lot of code, and it means we can access SplitFiemaps
throughout the installation process. Note that FiemapWriter no longer
keeps an open descriptor, so we're not keeping a bunch of handles open
for no reason.

Second, writes will either flow to an fd (backed by device-mapper), or
to a SplitFiemap (potentially backed by many fds). To make this seamless
there is now a WriteHelper interface that has two methods: Write, and
Flush.

Finally, the way pinning is checked has changed. For individual writes,
it is now the responsibility of the WriteHelper. At the end, we verify
that each partition is still pinned via a helper in SplitFiemap.

Bug: 126230649
Test: gsi_tool install works
Change-Id: Ic243dd0c582567f924052106c4f414f5d53cd528
2 files changed