Mark tickets overdue which have no SLA

If a ticket has a due date and does not have an SLA set, the ticket would never transition to overdue. This patch addresses an SQL flaw preventing the ticket from being transitioned.

Fixes #757