reorder incr/decr operation to be safer.

looking for explicit refcount numbers before doing anything.

other parts of the code will require refactoring for this to be fully safe.