Use thread-local storage for global program cache
Merge pull request #269 from kylelutz/thread-safe

Use thread-local storage for global program cache