Fix two missing error condition detections in encodeVariant
Fix two missing error condition detections in encodeVariant

One caused a test failure, the other caused memory corruption (valgrind
complained about jump conditions on uninitialised data).

Signed-off-by: Thiago Macieira <0ed1648d92ca0373297a182b1dba1b974ad10d88@intel.com>

thiagomacieira/tinycbor,01org/tinycbor,thiagomacieira/tinycbor,thiagomacieira/tinycbor,intel/tinycbor,01org/tinycbor,thiagomacieira/tinycbor,intel/tinycbor,01org/tinycbor,intel/tinycbor,intel/tinycbor