Make 'stdin', 'stdout' and 'stderr' thread local.

NOTE: Because the java type of those items changed from
PrintWriter/BufferedReader to ThreadLocal<PrintWriter>/ThreadLocal<BufferedReader>
this change is binary backwards compatible. In particular,
code compiled with an earlier version will try to access
'stdout' as 'PrintWriter'.