Properly check for termintated print streams.

All PrintStreams need to be checked for termination via
the checkError method (i.e. they do not throw exceptions
if the underlying resource is closed they just swallow
the error). To do this this change extracts print and
printLines combinators (partially so this can be tested,
but also because they are generally useful).

To demonstrate this issue it is possible to construct
an application from a process of:
  Process.constant("y").to(io.stdOutLines).run.run

And then try to run the app with something that closes
the output stream, for example:
  java -cp ... yes | head

The correct behaviour for this is the program should
exit after printing "y" 10 times. However, before this
change the program would print "y" 10 times than run
forever.
Update pull request #181
Do not specialize io.channel to Task
Do not specialize io.resource to Task
Do not specialize io.bufferedResource to Task
Put the String that causes lines to fail into LengthExceeded
Fix premature disconnect of side with wye.haltL/R
Merge pull request #273 from edwinchoi/wye-halt-fix

Fix premature disconnect of side in wye.haltL/R
Merge pull request #266 from fthomas/generic-channel

Do not specialize io.channel to Task
Merge pull request #235 from MrAIring/update-#181

Update #181
Merge pull request #272 from fthomas/lines-ex

Introduce a LengthExceeded exception for text.lines
Using `End` rather than `Kill` in print channel error handling
Merge branch 'master' into master-a
Fix compile error in PrintSpec test