encoding: Ensuring minimal-length encoding for nonNegativeInteger

Change-Id: Iefb758530729f6c520c90dd36eeff2f43401f62e
refs: #1284