Predicting Deadlock in Store-and-forward Networks