clean up LeafQuery visitor id management