Reverse a stack in-place