Remove bad use of strncpy and double string copy in socket_monitor thread