Makefile.am: fix making the cw executable script.
cw.lua: fix a FIXME and use posix.isatty to test stdout & stderr.