Simplify edit.c functions replace_{push,pop}.

* Replace xmalloc (+memmove) with xrealloc
* Code style adjustments.
* Remove obsolete TODO comment