A Sequential Quadratic Hamiltonian Method for Solving Parabolic Optimal Control Problems with Discontinuous Cost Functionals