add tty_lock support for FreeBSD