periodicity: fix infinite loop with impossible combinations of week and months

Some combinations of periodicity, for example repeat every first week
of the year and every month February are impossible (because the first
week of the year is always in January) and such configurations caused
infinite loops or probably overflow if we wait long enough.

The algorithm being to try the next day until all constraints are met,
it is not guaranteed to terminate.

To make sure the algorithm terminate, we rely on the fact that calendars
repeat after some time, so if after a few years we did not find a
matching combination, we can stop retrying.

according to https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week

> Each leap year repeats once every 28 years, and every common year
> repeats once every 6 years and twice every 11 years.

so trying for 28 years should be enough to see all combinations
3 jobs for fix/periodicity_impossible_combinations in 0 seconds
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-TestRunner1

00:46:45

passed ERP5.PerformanceTest-TestRunner1

00:26:26

failed ERP5.UnitTest-TestRunner1

01:52:27