Fix endianness dependency in IpAddress

Current implementation byte swaps while reading the native
type, then byte swaps to convert to network order for inet_ntop
on little endian targets.

For big endian address spaces, this could would produce
incorrect results, as the native type would be in network byte
order, causing the struct.pack to mess up the IP address.

This aligns the conversion like it's done for IPv6 addresses.