Make partial mocks thread safe

Partial mocks use a shared table. Without this patch, concurrent accesses to
the shared table will cause crashes.
Merge pull request #32 from socialize/thread-safe-partial-mocks

Make partial mocks thread safe