FreeBSD: use modern pts(4) interface instead of the old pty(4) one

Add _IOC macros (ioccom.h) for bsd's and unify the ioctl() calls.