Platform crashes after a while (AS)
The program crashes after a while when different objects are being rendered. 

To reproduce this, follow the Setup for a HelloWorld AS application and make this little change in main.ts:

```
// ... as in the template

let counter: i32 = 0;

export function update (): void {
    store<u16>(w4.DRAW_COLORS, 2);
    w4.text("Counter: " + (counter++).toString(), 10, 10);

// ... as in the template
```

![image](https://user-images.githubusercontent.com/7925050/130349687-0b0c4bd8-c14f-48f8-9343-9c1d6a630a30.png)

Same behavior in Chrome and Firefox.

I spotted this when developing a game but the code above is a minimal example.