Fix thread-related bugs in the callback wrapper code:  * we need to make sure the thread structures are initialised  * in engine calls such as synchronize, the engine may need to call     back to us with a callback on the same thread, so to avoid deadlock    these calls must be wrapped in Py_BEGIN/END_ALLOW_THREADS macros
Fix thread-related bugs in the callback wrapper code:
 * we need to make sure the thread structures are initialised
 * in engine calls such as synchronize, the engine may need to call 
   back to us with a callback on the same thread, so to avoid deadlock
   these calls must be wrapped in Py_BEGIN/END_ALLOW_THREADS macros

This code works for me now, as long as you aren't using the 
python-module plugin wrapper (ie. no python plugins). There are a whole 
lot of separate issues to fix there.


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

ianmartin/opensync,ianmartin/opensync