Fixed memory leak in iterative seamcarving.