Avoid using a (possibly invalid) EventContext pointer
Intermittent issue documented here: https://its.cern.ch/jira/browse/ATEAM-471
An EventContext pointer had the potential to be used after deletion. Since the pointer wasn't really necessary I've refactored the updateStates() method to avoid it.
Since the problem only appears sometimes, I can't confirm that it's fixed. However, this can't hurt.
Regards, Ben