percpu: implement generic percpu refcounting

This reverts commit 7ff332b5672811d2b9d857866cedeadc4d06d9e5.