gpt: record size of of the entries table

The size of the entries table will be needed later when writing it back
to disk. Restructure the entries reading code to flow a little better.
gpt: consolidate crc32 computation code

The gcrypt API is overly verbose, wrap it up in a helper function to
keep this rather common operation easy to use.
gpt: add new repair function to sync up primary and backup tables.
gpt: add write function and gptrepair command

The first hint of something practical, a command that can restore any of
the GPT structures from the alternate location. New test case must run
under QEMU because the loopback device used by the other unit tests does
not support writing.