A non-Markovian model of avalanche gain statistics for a solid-state photomultiplier