Added some deallocation statements to the destructors of the adjoint solver