Practical photon number detection with electric field-modulated silicon avalanche photodiodes