add signal handling for SIGWINCH, so we can keep track of terminal size.

Terminal size is needed for later when implementing telnet NAWS, as well
as is useful for deciding size for line buffering & other things.