Update LuaRocks spec file and related documentation
Some reorganizations in the makefile code
Avoid memory leak when function is called with wrong arguments

When called with the wrong argument type, this function returned to Lua
error handler without freeing the previously allocated memory. Fixed.