Fix the parsing of the type field in Event msgs

- According to the standard, the most significant bit of the 8-bit type code is
  used to flag if the event was generated from a SendEvent request. See Event
  Format section in Chapter 1 of the specification.