Many functions of LegacyTimePeriod take a tm pointer as an input parameter and
then pass it to mktime() which actually modifies it. This causes problems if
tm_isdst was intentionally set to -1 (to automatically detect whether DST is
active at some time) and then a function is called that implicitly sets
tm_isdst and then the values of tm are modified in a way that crosses a DST
change. This resulted in 1 hour offsets with ScheduledDowntimes on days with
DST changes.
If Icinga2 was restarted with a newly configured downtime that should
be in effect at the time of restart, the should-be-running segment of
it was not put into effect.
Add new LegacyTimePeriod::FindRunningSegment() and
ScheduledDowntime::FindRunningSegment() functions, call the latter in
ScheduledDowntime::CreateNextDowntime() before trying the old
ScheduledDowntime::FindNextSegment().