bpo-33316: PyThread_release_lock always fails (GH-6541)

Use correct interpretation of return value from APIs.
2 files changed