Fixed by clamping current index value to 0..list_size-1 range in list event
handling function. This shouldn't give any regressions since this clamping\
happens only after template was already displayed so items counter should be
correct here.
It is still possible to set index to meaningless value by directly changing
the index value via python, but that's not in the scope of interface engine
and not currently considered a bug.