On the measurement of the proton-air cross section using air shower data