Network system bugfixes

This patch fixes a number of bugs in the network code:

* Nullrdc: when sending a list of packets, the code previously sent only the first packet. This made retransmissions of fragmented IPv6 packets fail, as only the first fragment was sent.
* UDP packet send: check the size of outgoing packets to avoid sending packets that overwrite the output buffer.
* CSMA: be defensive against being called with a NULL packet argument, which would otherwise crash the system.
* Compile the rimestats variable only if rimestats are enabled.
* Some code style cleanups and printf() argument fixes.