Most of the commands can only be called if we have the GIL: retrieve it. Add a controlled type to automatically retrieve/free the GIL. Lock every call using Py_INCREF/Py_DECREF. Change-Id: I8989fcb3eacf6aedbb90056469536144a2795a3f