[bugfix] import distutils later in version.py
[bugfix] import distutils later in version.py

- with setuptools 49.2.0 it is discouraged to import distutils before
  Setuptools. Therefore import distutils when needed
- also remove Python 2 related code in version.py

Bug: T257772
Change-Id: I4d0a0cc7a68d7e7d80069d09b8f03b4990e2b8ad

wikimedia/pywikibot-core,wikimedia/pywikibot-core