Fixed #21546 -- Strengthened kqueue detection.

Thanks Loic Bistuer.