backend/session: Run libseat callbacks on idle
libseat callbacks can be triggered from the stack of a libseat call if they were read while waiting for a return value. This is necessary as dispatch will not be called when the file descriptor has already been drained.
This leads to issues if we're called by libinput to close a device, and then handle a disable event that leads to libinput closing all its devices.
As workaround, break the stack on libseat events by executing them as idle events.
Fixes: https://github.com/swaywm/wlroots/issues/3200
TODO:
-
queued idle events could fire after wlr_session_destroy (use-after-free)