On macOS, the kqueue mechanism appears to create an internal FD that wrongly triggers the leak condition.
fix #115