Avoid any code before locks in the API

For consistency in the C API, avoid any initializations before
callling lua_lock.
3 files changed