[WO-594] Try to get machine hostname from the socket object if available

applies to wsShim