Checks if any sources have pending events for the given context.
a main context (if `NULL`, the global-default main context will be used)
true if events are pending, false otherwise