Fix a couple of bugs in MCStack::paste

Pasting stacks suffered from a memory leak. Additionally, it would have failed an assert if the pasted stack had to be renamed to "Copy (<n>) of ..." in order to avoid name clashes.