In PyCommand obtain the GIL

Change-Id: Ia70ad36e0b4e0545d5d2b8547fe04d8b7739ba7f