More threading fixes:  * use PyGILState API instead of PyEval_AcquireThread/ReleaseThread    This simplifies the code here, and we don't have to worry about if     we're already on a thread.  * Make sure threads are enabled before any Py_BEGIN_ALLOW_THREADS call
More threading fixes:
 * use PyGILState API instead of PyEval_AcquireThread/ReleaseThread
   This simplifies the code here, and we don't have to worry about if 
   we're already on a thread.
 * Make sure threads are enabled before any Py_BEGIN_ALLOW_THREADS call

Combined with the change I'm about to commit to python_module.c, this 
appears to fix the problem with engine callbacks and python plugins 
being used at the same time.


git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@2229 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e

ianmartin/opensync,ianmartin/opensync