Ensure the session handle isn't referenced after we have freed it.