Modify tools.finalize.check_changes to validate extensions
Modify tools.finalize.check_changes to validate extensions

The previous existing implementation would just check for the existence
of a preconfigured substring (e.g. `changes`, `doc`, ...).
However that can be problematic when the used extension contains one of
the valid substrings but is not valid itself.

For example `changelog.d/3034.docs.rst` contains the valid `doc`
substring but is not a valid name itself. The correct would be
`changelog.d/3034.doc.rst`.

pypa/setuptools,pypa/setuptools,pypa/setuptools