databases/py-gdbm: fix build with Python 3.12+
Certain internal headers are included unconditionally starting with
Python 3.12, but this should have been built with the appropriate
preprocessor macros for internal headers set anyway.
PR: 286298
Event: Kitchener-Waterloo Hackathon 202506