Test: additional logging
test: RelocationTests.testCancellationCleansTempFiles may fail due to io errors while check temp files are deleted

Windows can throw NoSuchFileException when using File.walkFileTree and deleting files concurrently. This commit changes IO exceptions into assertion error so that assertBusy will wait for them as well.
[UTILITIES] Introduce a RefCounted interface and basic impl

We already have two places duplicating this rather hairy logic, this
commit intorduces a new RefCoutned interace and an abstract implementation
that can be used for delegation. It factors out all the reference counting
and adds single and multithreaded test for it.

Closes #8210