gpg: More carefully encode a packet's length.
* g10/build-packet.c (write_header2): Make sure the length bits are cleared. Fail if HDRLEN is set and the specified length can't be encoded in the available space.
- Signed-off-by: Neal H. Walfield <neal@g10code.com>