Fix Race Condition in Particle Box

- fix bug that memory writes in `setAsLastFrame` and `setAsFirstFrame` are not in order

This bug was not triggered by the current `dev` or `master` branch.

~~**PLEASE do not merge, I think our compile suite isn't working.**~~