Fix #1236: Implement java.io.PrintWriter.

You are seriously saying that the JDK doesn't call `checkError` on the underlying stream if this stream is closed? OMG...