VideoCommon: loop bug in ShaderGenCommon.h debug

@neobrain I'm not sure how to test this, but this change seems to avoid that referencing-past-the-end-of-the-buffer problem. Can you verify that the loop still performs as originally intended?