Fix build warnings with gcc in EncodeDecodeTest

Avoid a comparison between signed and unsigned integers, and avoid
a warning about a variable which is set but not used.
Merge pull request #1357 from mstorsjo/silence-warnings

Fix build warnings with gcc in EncodeDecodeTest