Fix #1261: Forward-port additional test for #1252

Originates from: c63d49981b4e7b86e13c4888b3bf680e27bcfdaf which is a
backport commit to 0.5.x that adds an additional test case.
Merge pull request #1264 from gzm0/backport-test

Fix #1261: Forward-port additional test for #1252
Fix #1266: Proper connection closing on Node.js ComJSEnv
Merge pull request #1267 from gzm0/fix-nodejs-race

Fix #1266: Proper connection closing on Node.js ComJSEnv
Implement part of java.nio.{Byte,Char}Buffer.

These are required to implement Charset encoders and decoders.
Implement the standard Charset encoders and decoders.

* US-ASCII
* ISO-8859-1
* UTF-8
* UTF-16 BE/LE/auto

This also fixes #1087: String.getBytes().