Fix for not generating emails for task/cycle overdue after cycle has ended

Fixes b/17043831