Add casts to avoid warnings about comparison between signed and unsigned

Review at https://rbcommons.com/s/OpenH264/r/868/.