HPCC-10224 Fix CSocket::name returning non terminated strings

CSocket::name, which returns the local server address rather than the
peer address, doesn't seem to be used except a few places in ESP.

The function was memcopying strings without including the null terminator.

Also fixes a couple other issues, like attempting to write to a null
string.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Merge pull request #5060 from afishbeck/getServAddress10224

HPCC-10224 Fix CSocket::name returning non terminated strings

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>