Measurements of pKa of organic molecules using third-order nonlinear optics