Restructure imports

_inet_ntoa and _socket are unused. inet_aton is always imported from
socket, regardless of platform.
Remove unused imports