test-utils: socket utils improvements, style

Signed-off-by: Ketoth Xupack <ketoth.xupack@gmail.com>