EventDispatcher: optimized access of listener[i] in removeEventListener()

Saved listener[i] into a variable so that you don't need to access it twice while looping.