Calling `PyEval_InitThreads` has been deprecated in Python 3.7 and the
function itself will be removed in Python 3.11. The current check
guards this function behind a version check that only happens at compile
time.
This in turn leads to crashes when run on Python 3.6, as the necessary
initialization for `PyEval_ReleaseThread` did not take place.
This commit ensures the manual initialization takes place based on the
runtime version of Python and avoids loading the associated symbols
on Python 3.9 or later.