python: use sync.Mutex for protecting Python calls, extend error handlers (#2746)
python: use sync.Mutex for protecting Python calls, extend error handlers (#2746)

I've found several issues when using `dlpython` GIL helper functions, mostly because there might be internal calls that weren't correctly mapped when preparing the bindings. I did many experiments with it and the simplest approach is to control the lock in the Go side, with this we can avoid additional `cgo` overhead (in 2.8 we were controlling the GIL using the CPython calls).

Performance gets slightly better, less context switches and CPU usage as well, I'm comparing 2.8.6 (with previous approach) with this 2.9.x patch. It should protect all calls and ensure no crashes related to `PyCallObject`:

<img width="920" alt="test1" src="https://user-images.githubusercontent.com/20110/71085093-9eb5ab00-218e-11ea-86af-695893d84abf.png">
<img width="924" alt="test2" src="https://user-images.githubusercontent.com/20110/71085094-9eb5ab00-218e-11ea-952e-a67d7d592423.png">

<img width="1115" alt="cpuinterrupts" src="https://user-images.githubusercontent.com/20110/71085118-abd29a00-218e-11ea-8b83-4ef0c038d30a.png">
<img width="1087" alt="cpuusage" src="https://user-images.githubusercontent.com/20110/71085119-abd29a00-218e-11ea-8c2d-0e828f114504.png">


Fix for: https://github.com/TykTechnologies/tyk/issues/2760
lonelycode/tyk,lonelycode/tyk,lonelycode/tyk