request_id isn't thread safe

The way request ids are generated isn't thread safe.

In particular having a global static SV * variable (i.e. static SV * request_id) is wrong

I managed to trigger the race condition in the test case by increasing the number of threads and the number of inserts.

Made a quick fix, by using a Perl shared variable and passing the value to the corresponding functions.