Compile with more warning, fix some build errors

Errors where mostly du to signed/unsigned comparaisons.
Function for convert packet data in network data and for free a packet.

There were before a function to free packet data (if any), but not the
whole packet, fixed.  (I wonder how I didn't think of adding that before...)