Bugfixes in Variant encoders/decoders
Bugfixes:
- Array size limit was not enforced
- Nested variant limit was not enforced
- Array type field was not set correctly when it is a single value
- encodingByte was invalid when encoding a Matrix (arrayValue flag was not set)
- fix memory leak in degraded case of decoding (Matrix)
- Improve error return codes