Fix adding and removing data listeners.

Previously if a data listener got added,
the iterator got multiple extra listeners
of which only 1 would be removed,
causing an exponential growth in listeners
every time a new data listener got added/removed.