Add lua_getmainthread function to return main thread.