Inotify: fix read hanging and watcher close