Make calc project deadlines more secure

Try to protect against the case where the project got deleted. In
the past this lead to a bizzare bug where all active tasks in the
system had their deadlines reset.