Teach configure --with-python to report the Python version number.

We already do this for Perl and some other interesting tools, so it
seems sensible to do it for Python as well, especially since the
sub-release number is never determinable from other configure output
and even the major/minor numbers may not be clear without excavation
in config.log.

While at it, get rid of the code's assumption that both the major and
minor numbers contain exactly one digit.  That will foreseeably be
broken by Python 3.10 in perhaps four or five years.  That's far enough
out that we probably don't need to back-patch this.

Discussion: https://postgr.es/m/2186.1522681145@sss.pgh.pa.us
