encoding: In decodeTypeAndVal, quit the loop if read past the end of the input. Refs #1034.

Change-Id: I46a4d980cc10a71b2cc4beaeda9ef904541c042b
Merge branch 'issue/1034-decodeTypeAndVal-infinite-loop'

Refs #1034 http://redmine.named-data.net/issues/1034

Change-Id: I54d4f11785f125c5934d0b3e59984fc51ec673bd