t/imapd: workaround a Perl 5.36.0 readline regression
Buffered readline (and read) ops under Perl 5.36.0 fails to read
new data after writes are made by other file handles (or
processes).
To fix and improve our test, introduce a new, (currently)
test-only TailNotify class to use inotify or kevent if available
to workaround it while avoiding infinite polling loops. Further
refinements to these test APIs since we use the same pattern for
testing daemons in many places.
This also fixes the TEST_KILL_IMAPD condition in t/imapd.t under
GNU/Linux, AFAIK that test was never reliable under FreeBSD.
Link: https://bugs.debian.org/1040947