Fix issues in latest event queue interfaces
Fix issues in latest event queue interfaces

This addresses three issues, mainly from the last round of
event queue interface additions:
- The return code of several helper routines was inconsistent
  with the QueueRecords fetch routine and as a result wrong
  return codes from fetch would be returned.  Resulted in a
  few no-values returns instead of the actual values.
- the global event client count was looking at only the first
  client instead of all, thanks to a pointer bug, and would
  have returned incorrect values (if not obscured by another
  issue, above).
- Leaking context memory, due to incorrect check to see if
  a context exists and is in use rather than always allocing
  a new one.  (this bug has actually been there for awhile)

wuliming/pcp,prasincs/pcp,tjanez/pcp,ryandoyle/pcp_original,edwardt/pcp,ryandoyle/pcp_original,tjanez/pcp,mbaldessari/pcp,aeg-aeg/pcpfans,wuliming/pcp,adfernandes/pcp,andyvand/cygpcpfans,edwardt/pcp,tjanez/pcp,mbaldessari/pcp,tjanez/pcp,adfernandes/pcp,aeg-aeg/pcpfans,ryandoyle/pcp_original,prasincs/pcp,edwardt/pcp,andyvand/cygpcpfans,mbaldessari/pcp,prasincs/pcp,tjanez/pcp,andyvand/cygpcpfans,adfernandes/pcp,edwardt/pcp,aeg-aeg/pcpfans,wuliming/pcp,aeg-aeg/pcpfans,adfernandes/pcp,edwardt/pcp,edwardt/pcp,adfernandes/pcp,andyvand/cygpcpfans,prasincs/pcp,adfernandes/pcp,aeg-aeg/pcpfans,tjanez/pcp,prasincs/pcp,edwardt/pcp,prasincs/pcp,andyvand/cygpcpfans,adfernandes/pcp,ryandoyle/pcp_original,wuliming/pcp,edwardt/pcp,adfernandes/pcp,mbaldessari/pcp,aeg-aeg/pcpfans,tjanez/pcp,wuliming/pcp,aeg-aeg/pcpfans,mbaldessari/pcp,ryandoyle/pcp_original,wuliming/pcp,ryandoyle/pcp_original,ryandoyle/pcp_original,andyvand/cygpcpfans,aeg-aeg/pcpfans,tjanez/pcp,mbaldessari/pcp,prasincs/pcp,wuliming/pcp,andyvand/cygpcpfans,ryandoyle/pcp_original,andyvand/cygpcpfans,wuliming/pcp,prasincs/pcp