CA-100000: Don't use lexicographic sort when sorting events

Bug introduced during rpc-light integration. The type of 'id' was
changed from an int to a string, and the type checker used to fix
the code. Unfortunately there was a sort function using the
polymorphic 'compare' function. The compare thus changed from an
integer comparison to a lexicographic compare on the string
representation of the integer. The observable result in this case
was that e.g. event '1000' was 'older' than event '999' and was
GCd. Elsewhere, the correct integer comparison was being made and
this caused the event.next to raise 'EVENTS_LOST'.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1044 from jonludlam/CA-100000

CA-100000: Don't use lexicographic sort when sorting events