TST: Fix buggy ref-count test