Fix a logic error in post, put, and erase where invalidation of weak_ptr to transaction in the stack results in noop

Now use an assert to check for correctness