so that the right external reference count is released when the proxy is destroyed. Protect all changes to refs in the ifproxy using interlocked functions and update the thread-safety documentation.