Fix CopyStr (substr in system.nim) for javascript target

For example this printed ba instead of bar:
```nimrod
var x = "foobar"
echo x.substr(3)
```