m_spanningtree Do pointer comparison before deleting one of the pointers in TreeSocket::Squit()

While the previous code worked fine in practice, it was incorrect in theory
Improve detection for non-cidr masks to prevent unwanted matches

Fixes issue #762 reported by @neoinr