Fix a crash that can occur if a peer reports a chain height of zero (this is a protocol violation but such crashes were seen in the wild).
Fix parsing of empty labels and messages, and parsing of labels and messages with an unescaped equals sign in their value.
Fix size of encrypted bytes when encrypting private keys. Also change decrypting to use similar code.