Fix tests and add CI for FreeBSD
This merge request fixes all test failure found on FreeBSD 11.1 and 11.2 as well as a few problems in meson builds. Most changes are related to the kqueue file monitor which can be complex, so I tagged a few developers who are known to work on *BSD here: @ajacoutot @jasperla @kwm.
This merge request doesn't fix test failure found in autotools builds, and I didn't check why the result of autotools builds was different from meson builds. The GitLab CI runner in my fork currently runs on an unreliable FreeBSD VM which is not suitable for CI works. It will be very nice if someone can provide a FreeBSD GitLab CI runner after this branch is merged.