Fix logic to find available next number for limiters and queues. It fixes #3998
Fix logic to find available next number for limiters and queues. It fixes #3998

BlackstarGroup/pfsense,NewEraCracker/pfsense,NOYB/pfsense,pfsense/pfsense,phil-davis/pfsense,NOYB/pfsense,phil-davis/pfsense,ptorsten/pfsense,NewEraCracker/pfsense,brunostein/pfsense,BlackstarGroup/pfsense,pfsense/pfsense,ptorsten/pfsense,pfsense/pfsense,phil-davis/pfsense,jxmx/pfsense,jxmx/pfsense,NewEraCracker/pfsense,pfsense/pfsense,dennypage/pfsense,ch1c4um/pfsense,brunostein/pfsense,jxmx/pfsense,ch1c4um/pfsense,NOYB/pfsense,ch1c4um/pfsense,phil-davis/pfsense,brunostein/pfsense,BlackstarGroup/pfsense,dennypage/pfsense,BlackstarGroup/pfsense,ch1c4um/pfsense,ptorsten/pfsense,NewEraCracker/pfsense,dennypage/pfsense,dennypage/pfsense