[perl #118843] work around recv() behaviour on cygwin

cygwin inherits recv behaviour from the Win32 sockets API which doesn't
modify the namebuf or it's associated size when you recv() from a
connected socket, handle this the same way Win32 does by zeroing the
length if it's the same as before calling recv().

Also adds some basic socket function tests to the core tests.