Fix logic bug in FDWatcher wait()