add freebsd ioctl support and a tty ioctl