tvhpoll: Various kqueue fixes for FreeBSD

- EVFILT_WRITE and EVFILT_READ are negative numbers so it's better to set them individually to avoid having to deal with negative bitwise or.
- Properly check timeout because default value is -1
- Use correct variable kevent.filter to detect which event was triggered