Make NewPacket thread safe