backport calendarspec fix for reverse DST change and safety net
backport a patch that copes with mktime moving backward for change to
"summer time" like the Ireland/Dubline TZ (uniquely) does, as for
them the summer time is the standard time. And such, IIUC the
algorithm was caught in an endless loop as basically it continued to
jump back before the time change and redid that time change; this is
not a problem for other TZ as they got the standard time switched and
such time only "moves back" on switch from DST to standard time,
where the switch then doesn't happen anymore.
Additionally add a safety net that aborts calendar spec calculation
after 1000 iterations.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>