gpt: rename misnamed header location fields

The header location fields refer to 'this header' and 'alternate header'
respectively, not 'primary header' and 'backup header'. The previous
field names are backwards for the backup header.
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.
Merge pull request #2 from marineam/gptprio

GPT write support and repair command