Properly grab hostname from socket
Fixes an issue where the gethostname() function is undefined, since it wasn't explicitly imported from the socket module.
Fixes an issue where the gethostname() function is undefined, since it wasn't explicitly imported from the socket module.