KNN-based detector for coherent optical systems in presence of nonlinear phase noise