Wrap all errors to implement net.Error.
Caller of Read/Write can check err.(net.Error).Temporary() to determine
whether the error is fatal or not, as with raw net.UDPConn.
Split errInvalidPacketLength from errLengthMismatch.
errInvalidPacketLength is used for errors caused by incoming data,
which must be discarded, and errLengthMismatch is used for errors
due to the data generated by the library, which is a fatal internal
error.