Fix bugs in event error checking code.
Fix bugs in event error checking code.

HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,zcth428/hpctoolkit,zcth428/hpctoolkit111,zcth428/hpctoolkit111,zcth428/hpctoolkit111,zcth428/hpctoolkit111,zcth428/hpctoolkit,zcth428/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,zcth428/hpctoolkit111,zcth428/hpctoolkit,HPCToolkit/hpctoolkit,zcth428/hpctoolkit,HPCToolkit/hpctoolkit