Backend: Fixed stale thread state in poll devices.

The current thread was left swapped in during co_wait_interpreter()
in POLL_DEVICE_SET_EVENTS().

Also fixes condition variable leak (probably not relevant in most
thread implementations, but...).