compat: backport n_tty_ioctl_helper