Remove dead stack-checking code.

Code under HAVE_STACK_LIMIT is not used.
The definition was commented out in rev 180 of the original
Mercurial repo, and then completely removed in rev 2520,
but the code guarded by it was left in.
Remove traces of old custom undo memory manager.

There were two memory management implementations,
standard malloc-based, and a custom allocator.

Removed in rev 2230 in the Mercurial repo.