Issue #11: use socklen_t instead of int where appropriate

Also check for valid recvaddrlen before processing a received MDP packet.