Use InvalidTitleError instead of InvalidTitle in property_statistics.py
It turns out this exception was renamed in cf630158c5 [1],
and released as part of pywikibot 6.6.2.
As we upgraded from 6.6.1 to 7.2.0 in d395b4cec,
we were now hitting the following exception:
AttributeError: module 'pywikibot.exceptions' has no attribute 'InvalidTitle'
- Add unit test test_make_stats_for_one_grouping_with_grouping_link_failure which tests the exception raising and the logging, and would have caught this
- Catch InvalidTitleError instead of InvalidTitle.
[1] https://github.com/wikimedia/pywikibot/commit/cf630158c523136c19a53370ba5df3f5953153c0
Bug: T309861