Fix #1236: Implement java.io.PrintWriter.

Who specifies this behavior? It also should apply in the closed case if it is really how the JDK does it. Drop a comment that this has been experimentally found (if it is the case).