Added support for FreeBSD (copy pty_linux.go)