tools/configurator: add HAVE_SYS_TERMIOS_H

As recently required by ccan/opt.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
opt: test HAVE_SYS_TERMIOS_H via #if

As ccanlint warns.  Also, test TIOCGWINSZ before ioctl, rather than the
header directly since it's a little orthogonal.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
opt: fix tests for 64-bit systems.

Actually, only an issue for 64 bit big endian systems, but still...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>