Fix for 1191 (detachEventHandler causing undefined index in CListIterator)

Modify CComponent to handle if an eventHandler has been removed while iterating over the event handlers.

fixes #1191 
More specifically, the reason why the isset() is necessary is not that the the item has been set to null in `$this->_d`, but that the iterator can overflow to an index that no longer exists.

With that in mind, we might be able to just modify `CListIterator::valid()` to check the size of `$this->_d` everytime.
```
public function valid()
{
    $this->_c = count($this->_d);// recaclulate in case $this->_d has changed
    return $this->_i < $this->_c;
}
```