Patch from Ton van Overbeek to fix a small memory leak in midend_solve(). [originally from svn r6271]