Development of a near-infrared photon-counting system using an InGaAs avalanche photodiode