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 
Ideally, yes. The problem is that the modification is happening on the CList object, not the CListIterator object (which has a reference to CList's data array). To get around this we would have to have CList keep references to all iterators generated and modify their state whenever an item is removed

CList:
```
private $_iterators = array();
public function getIterator()
{
     $iterator = new CListIterator($this->_d);
     if (! $this->_r) // Only keep track of iterators if the data can be changed
          $this->_iterators[] = $iterator;

     return $iterator;
}

public function removeAt($index)
{
     // ...
     foreach ($this->_iterators as $iterator) 
     {
          $iterator->revalidate();
          if ($iterator->key() === $index)
               $iterator->next();
     }
     // ...
}
```
CListIterator:
```
/**
 * Method to ensure the iterator is in a valid state
 */
public function revalidate()
{
     $this->_c = count($this->_d);
}
```

This would be a more direct fix to the issue, but I wasn't sure what the implications of keeping track of the iterators would be.