properly free some memory

highly unlikely leak if fetching stats then disconnecting in some weird order.