Using mutexes around accesses to refcounts seems to make the Windows build much less...