Add casts to avoid warnings about comparison between signed and unsigned

This fixes warnings with gcc.

Review at https://rbcommons.com/s/OpenH264/r/906/.