Replace deprecated library imp with importlib
Running the libapache2-mod-python package with Python 3.12 failed.
This is caused by the missing library imp in Python 3.12.
The Python library imp is marked as deprecated since Python 3.4 and was removed in Python 3.12. The documentation recommends replacing it with importlib. See https://docs.python.org/3.11/library/imp.html
This merge request replaces the deprecated library imp with importlib, adds debug output and a testcase for the cgi handler.