[sgen] Refactor pointer queue out of pinning code.