A Theoretically Sound Sequential Quadratic Programming Algorithm On Riemannian Manifolds