Optimise xterm output integration
Optimise xterm output integration

Before, I used to do `.subarray(...)` on the Wasm memory to keep same underlying buffer, and then I had to wait for xterm to confirm it wrote the data out, otherwise Wasm memory could be overwritten and corrupted before it actually prints it.

Now I switch to `.slice(...)` without waiting instead, so that Wasm can continue execution immediately, but it creates a bunch of small `Uint8Array`s instead. I was hesitant to do this before due to a potential GC pressure, but on practice this gives 5x improvement on e.g. `ls` on a folder with 2000 files.

GoogleChromeLabs/wasi-fs-access,GoogleChromeLabs/wasi-fs-access,GoogleChromeLabs/wasi-fs-access