There's no need to hold the mutex while constructing a `std::string` from the `char` string. Also use `inet_ntop` instead of the potentially thread-unsafe `inet_ntoa` that might use a static buffer for the result. This makes the `INet` case match the `INet6` case below.