Get local IPv4 address using sockets (cross-platform, std lib)