Impact and correction of CCD nonlinear response on measurement of the laser beam quality