Fix use-after free and race conditions in Wayland idle inhibitation
Coverity noticed a user after free, and after poking a bit I realized there are a few race conditions if we rapidly change the conditions for inhibiting, so I went and added some explicit state tracking.