Test and report error on kqueue()/kevent()/fcntl()