checkimages.py: Prevent TypeError when self.num_notify is None
checkimages.py: Prevent TypeError when self.num_notify is None

When the max notification is not set, self.num_notify will be None
instead of defaultdict, and attempting to reduce the value of an
element will result in:
TypeError: 'NoneType' object has no attribute '__getitem__'
We check if self.num_notify is not None earlier in order to prevent
this exception.

The logic of checking if the counter has ran out has also been changed
from `not value` to `value == 0` for clarity.

Follow up for I9e25b35d42af3c73c581c6d05a6a4a8dc8ef62c6

Bug: T157728
Change-Id: I7d5966c52dff4b342942abe030295f3e3c1f422f

jayvdb/pywikibot-core,npdoty/pywikibot,Darkdadaah/pywikibot-core,hasteur/g13bot_tools_new,magul/pywikibot-core,wikimedia/pywikibot-core,hasteur/g13bot_tools_new,jayvdb/pywikibot-core,wikimedia/pywikibot-core,happy5214/pywikibot-core,magul/pywikibot-core,npdoty/pywikibot,PersianWikipedia/pywikibot-core,happy5214/pywikibot-core,hasteur/g13bot_tools_new,Darkdadaah/pywikibot-core