Fix strange loop in sendMessageProto

Don't declare a new `var i`  within the scope of an existing `var i`.

Fixes #63