gh-136267: Read the target version from patchlevel.h in build-details.json (#161532)

With --with-build-python, the build Python can differ from the target in
patch version or release serial, but version_info and hexversion came from
the running interpreter. Read them from Include/patchlevel.h instead,
falling back to sys.version_info when the header is not there.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
3 files changed