model: add improved (?) deadlock detection