Measurement of charged-particle production in $\sqrt{s_{\rm NN}}=9.62$ TeV proton-oxygen collisions as a probe of cosmic-ray air showers with the ATLAS detector