Remove obsolete workarounds for shared_ptr.
Merge pull request #4279 from wmtan/RemoveSharedPtrWorkarounds

Remove shared ptr workarounds