utils: imp module is removed in Python 3.12 - get is_frozen() from _imp
extensions: address ast deprecations introduced in Python 3.12
vfs: handle shutil.rmtree deprecation of onerror in Python 3.12
tests: fix sortdict doctest with Python 3.12
utils: stop using datetime.utcfromtimestamp() deprecated in Python 3.12
hgweb: drop references to deprecated cgitb
setup: fall back to setuptools setup if distutils isn't available
tests: use simple mock smtp server instead of deprecated asyncore smtpd