Hysteresis in optical sensing and its impact on the analytical error of a calibration-free acid sensor