Fixed some of the memory leaks found by:

valgrind --leak-check=full wxmaxima 2>&1 >&debug

This program is really impressive.