[api] do not let delayed job crash when project or package of an event got removed already