kqueue tests: Add a regression test
Based on the test case submitted by Andreas Bock for PR 275286.
PR: 275286 MFC after: 2 weeks