Port TypePtr to QExplicitlySharedDataPointer

This merges two porting steps into one. TypePtr is actually a copy of
KSharedPtr, which is now deprecated in favor of QESDP.