Fixes APLO-338: PeriodStat buffer in Broker grows infinitely

Credit goes to Magnus Holm who identified the cause.