When using one connection across multiple threads, Cursor_FreeHandle has the chance to deadlock the python process given the right combination of other activity.
See the attached test script for a working example against v5.1.2.
Here is a patch which addresses this specific problem; it simply releases the GIL at the appropriate time.
You seem to have CSS turned off.
Please don't fill out this field.