mesa: Dynamically allocate the matrix stack.