Implement gethostname correctly for native Windows.