[api] track the number of delayed jobs associated with an event

so we can't delete events that have already send_mails jobs pending - or
we can't send mails about the events