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