Avoid warnings under Python 3.10

Fixed Python deprecation issues related to module importing, as well as
file access within the Lingua plugin, for deprecated APIs that began to
emit warnings under Python 3.10.  Pull request courtesy Petr Viktorin.

This modernizes the code to avoid `DeprecationWarning` and `ResourceWarning` encountered in the test suite under Python 3.10a4:
- [load_module](https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module) is deprecated
- Some files weren't being closed

This changes the semantics of the `compat.load_module` function: on Python 3.5+, the module is no longer inserted in `sys.modules`. All non-test calls did `del sys.modules[self.module_id]` right after the call, anyway. On older Python, the module is inserted and then deleted.

(Some additional `DeprecationWarning` come from Setuptools: https://github.com/pypa/setuptools/pull/2517)

Closes: #328
Pull-request: https://github.com/sqlalchemy/mako/pull/328
Pull-request-sha: 87c1d09e5f39de7b19e749568c437928580f7553

Change-Id: I9cb3772f6812ef14297792344caf2f9aa5337adf
6 files changed