inboxidle: avoid needless syscalls on refresh
We don't have to replace a bunch of existing watches
with identical new ones. On Linux with Linux::Inotify2
installed, this avoids a storm of inotify_add_watch(2)
and inotify_rm_watch(2) syscalls on SIGHUP with -imapd
and "-extindex --watch"
(cherry picked from commit
10bf54305da8422d9ece6b809996092c1c4b1786)
Note: this seems to fix missed wakeups with many watches,
so it's in the stable branch.
Link: https://public-inbox.org/meta/20201226201115.GA30142@dcvr/