Fix problem with removed subscriber

The previous commit introduced an error when a callback would remove
itself from the subscriber list and thereby caused the number of
subscribers to change while in the loop of calling the callbacks.