clear QueryElementNode memory when it is removed from the rete network