=act #3590 Reject task scheduled too far in the future

* Also fixes an overflow issue in checkQueue for periodic tasks