[gcs] Fix concurrency issue with Simulator::stacks_
We were accessing the Simulator's stacks_
member without locking,
which can lead to issues if allocating a new stack requires
reallocating the underlying memory.
Avoid this by caching the pointer to the active GuardedControlStack* and lock for converting an index to a GuardedControlStack pointer.