Watcher threads

All of these will mutate the server state under modifyMVar or
modifyMVar_, so that server transitions are more or less
atomic. The inotify handler remains active during polling mode, but
checks for polling mode and doesn't do anything in this case (this
check is needed even if we would unregister the event handler due
to how events are serialised).