Bug fix: Memory leak in libevent transport.

Signed-off-by: Leo Ma <leoma@credosemi.com>
Reduce malloc/free operations in datagram parsing.

Signed-off-by: Leo Ma <leoma@credosemi.com>