make SOCKET-RECEIVE work correctly when receiving overly-long UDP packets
Only copy as much data as the provided buffer can hold. Continue to return
the length provided from recvfrom as per documentation.
Fixes lp#1023438. Thanks to Robert Uhl for the fix.