test/free_function: fix failing test on LuaJIT 2.0

LuaJIT returned the same string as Lua 5.2, although it defines
LUA_VERSION_NUM as 501 (i.e. Lua 5.1).

Fix the test failure by comparing with both possible strings at runtime.