mesh: Fix model tree walk procedure
mesh: Fix model tree walk procedure

`bt_mesh_model_tree_walk()` was too simplistic and did not track visited
nodes which caused it to fall into infinite loop. Moreover the double
next jump could skip a level causing depth value to be invalid.

this is port of 3908638bab5966ac2e989a099a64141dff1116e1

apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble,apache/mynewt-nimble