A simple refcounting implementation.
Free anyway, ignore refcount for correctness, just performance to
measure performance.