fix closing if twisterd is not executed
to be sure read/write use utf-8 encoding
use intrinsic node.js escaping for path
Merge pull request #38 from dryabov/master

Minor fixes