route: fixed deadlock in routes.cpp

m_mutex and n->state_lock lock order was broken
Now m_lock is always taken before state_lock
Merge pull request #528 from toshic/master

route: fixed deadlock in routes.cpp