C++: Fix shared pointer handling for PacketPayload base class.