enable multithreading
Python is single-threaded by default and crashes (when using an
unitialized semaphore) respectively blocks (when the main thread still
holds the Python global interpreter lock when it is outside the
pycrosswalk extension).
To avoid this, pycrosswalk must initialize multithreading and be more
careful about entering/leaving methods using Python.
The thread in which XW_Initialize() gets called becomes the main thread.
It must release the global lock when returning to Crosswalk and restore
it when called again. Otherwise Python code called by other threads cannot
run. The assumption is that Crosswalk will always call the extension from
the same thread.
Without this thread support, pycloudeebus in xwalk-launcher does not work:
the main thread is running the glib event loop in which twisted reacts
to D-Bus calls, while the second thread runs a Crosswalk event loop and
would hold the Python lock if we didn't release it.