[LUA] Fixed last index buffering
When last index was equal to "currentStoreIdx", while loop was finished, and last index wasn't stored into the buffer since "idx" is reduced by 1 before the statement. Fixed by adding the value into the buffer withing the statement before break.