Use thread_specific_ptr for Lua.

Fixes #67.