Fix refcount unit test.

Turns out that it is allowed to destroy a refcount without attaching
to it first.