encoding: Fix bug in TlvEncoder.writeNonNegativeInteger: value <= 0xff should be encoded using 1 byte. Refs #1927.