encode: enforce the protobuf 2 GiB message-size limit (#271)