lib: fixed bad mallocs in socket

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
contrib: added wiringPi wrapper

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>