GenericAgentFinalize (added by this leak-fix branch, since there was no such tidy-up before) isn't a good place for this, given that it's not assured to be called without any other threads active.  So I'm leaving these here (and in TLSDeInitialize, which is the client-side equivalent).