Piecewise Sequential Quadratic Programming for Mathematical Programs with Nonlinear Complementarity Constraints