net: fixes some finding from coverity

Fixes several findings from coverity scan in the network stack.