Filter out duplicate events in main.c:xevent_filter()

xevent_filter() receives multiple duplicates for every event happening.
This leads to "monitors-changed" signal getting emitted multiple times,
and unnecessary recomputation in case of XSyncAlarmNotify and
configuration change.
Now, those duplicates will be filtered out and only the events from
event queue will be used.