Restructure esc decode loop

This will make it easier to add more codes
Add ctrl-left and ctrl-right to the xterm parser
Add ctrl-left and ctrl-right to the windows parser
Implement wordLeft and wordRight actions

Fixes #2
Implement ctrlW (delete word)
Implement home/end actions

Fixes #3
Make CtrlU behave like bash

Bash, readline, and vi all treat CtrlU as "delete to cursor". EMACS is
the oddball that treats CtrlU as "delete entire line".
Use signal.Stop (added in Go 1.1) to clean up state
Improve ReadHistory error messages

Also satisfy golint (errors should not be capitalized)
golint: Document State
golint: Rename timedOut to errTimedOut
golint: uncapitalize error that can't happen
Fix godoc on Windows

Add documentation to input_windows.go as suggested by golint.
Note the reason we ignore golint in input_windows.go
Break out common data and functions

line.go will soon have a build constraint so it doesn't compile on
unrecognized operating systems.
Add "always dumb mode" fallback

Now liner can always be used, even if the operating system in
use is not fully supported.
Stop prompt attempts on non-terminal stdout
Terminate the read goroutine at the end of each prompt

If the read goroutine is not terminated, it reads the next character
(always on Linux, and sometimes on Mac) and then blocks forever trying
to send that character to a prompt that is never going to arrive. This
is a loss-of-data bug, and also a memory leak.

Fixes #5 for most practical uses.

There are two (not very practical use case) exceptions:
1) Ctrl-D on an empty line causing io.EOF is not handled, since the
   status of the line buffer is not in *State (although it could be
   if this was a real issue for somebody). The expectation is that the
   controlling application will stop trying to read input on any error,
   including io.EOF
2) If there is sufficient type-ahead, bytes could be stranded in the
   read buffer when State.Close() is called. There isn't much that can
   be done about this without complicating the API unreasonably.
Merge branch 'master' of git://github.com/peterh/liner into upstream