Changed pointer to shared_ptr and added null check for content

Added a null check for content in sendpacket
Changed ThywinPacket* to use shared_ptr and the same for TPObject