Fix virtual_terminal.cpp build on FreeBSD
- need to shuffle some Linux includes behind an ifdef, and some FreeBSD ones as well
- FreeBSD has no notion of major device numbers anymore, so the isTty() function can't really tell. Just ignore the check -- I'm assuming the somewhat-standard isatty() doesn't do what is wanted, since otherwise it would be used.