This reverts commit d678fa56d127b93cfa10ccc53af81a6f3c9fa830. The
reference counter, flawed as it is, was masking far more issues than I
realized. It would require a more significant rearchitecture of the
code to remove it. Probably better to keep it and try to improve it for
now.