Fixed memory leak for Packet reader & writer

The PacketReader and PacketWriter didn't delete the allocated buffer
properly causing a memory leak.
Merge pull request #52 from SneWs/master

Fixed memory leak for Packet reader & writer