On the measurement of the proton-air cross section using longitudinal shower profiles